\documentclass{article}
\begin{document}
\SweaveOpts{concordance=TRUE}

<<>>=
load("/Users/hannahridge/Downloads/cses3.rdata")
#load cses3.rdata from CSES
library(car)
library(ordinal)
library(texreg)
@

<<>>=
# Removing Hong Kong, Belarus, Taiwan, Thailand because not countries/not democracies by Polity
cses3 <- subset(cses3, cses3$C1006_NAM != 'Hong Kong' & cses3$C1006_NAM != 'Belarus' & cses3$C1006_NAM != "Taiwan" & cses3$C1006_NAM != "Thailand")

### Removing Refused, Don't Know, Missing, and [See election study notes] responses from the SWD variable
cses3 <- subset(cses3, cses3$C3019 < 6)
@

<<>>=
### US citizens ages 90+ are coded as 1. Here I am changing all 1s in the US to 90s
cses3$C2001 <- ifelse(cses3$C2001 == 1 & cses3$C1004 == 'USA_2008', 90, cses3$C2001)

### Getting rid of the Refused, Don't Know, and Missing responses in the Age variable
cses3 <- subset(cses3, cses3$C2001 < 997)

### Getting rid of the Refused and Missing responses in the Gender variable
cses3 <- subset(cses3, cses3$C2002 <= 2)

### Getting rid of Missing responses for GDP variable (none removed)
cses3 <- subset(cses3, cses3$C5081_2 < 99999)

### Getting rid of Refused, Don't Know and Missing responses for the Campaign Involvement variable and recode so higher is more involvement
cses3 <- subset(cses3, cses3$C3018 <= 4)
cses3$C3018 <- recode(cses3$C3018,"1=4;2=3;3=2;4=1")

### Getting rid of [see election study notes] and Refused, Don't Know, and Missing responses to the Education variable
cses3 <- subset(cses3, cses3$C2003 <= 8)

### Turning outcome variable (SWD) into a factor
cses3$C3019 <- as.factor(cses3$C3019)

### Turning Gender variable into a factor
cses3$C2002 <- as.factor(cses3$C2002)

### Getting rid of [see election study notes] and Refused, Don't Know, and Missing responses to the ideology variable
cses3 <- subset(cses3, cses3$C3013 < 95)

### Creating a closeness to party scale
cses3$closeness <- NA
cses3$closeness <- ifelse(cses3$C3020_1 != 1, 0, cses3$closeness)
cses3$closeness <- ifelse(cses3$C3020_4 == 3, 1, cses3$closeness)
cses3$closeness <- ifelse(cses3$C3020_4 == 2, 2, cses3$closeness)
cses3$closeness <- ifelse(cses3$C3020_4 == 1, 3, cses3$closeness)

### Getting rid of [see election study notes] and Refused, Don't Know, and Missing responses to the income quintile variable
cses3$C20201 <- cses3$C2020 
cses3$C20201 <- ifelse(cses3$C2020 >5, NA, cses3$C20201)
@

<<Dv>>=
### Recoding dependent variable
cses3$C3019 <- recode(cses3$C3019,"5=1;4=2;2=3;1=4")
### Dependent variable is now: 1) Not At All Satisfied; 2) Not Very Satisfied; 3) Fairly Satisfied; 4) Very Satisfied
@

<<vote for winner>>=
cses3$vw <- 99
  cses3$vw[cses3$C1004=="AUS_2007" & cses3$C3023_LH_DC == 2] = 1
  cses3$vw[cses3$C1004=="AUS_2007" & cses3$C3023_LH_DC != 2] = 0
  cses3$vw[cses3$C1004=="AUT_2008"& cses3$C3023_LH_PL == 1] = 1
  cses3$vw[cses3$C1004=="AUT_2008"& cses3$C3023_LH_PL == 2] = 1
  cses3$vw[cses3$C1004=="AUT_2008" & cses3$C3023_LH_PL != 1 
               & cses3$C3023_LH_PL != 2] = 0
  cses3$vw[cses3$C1004=="BRA_2006" & cses3$C3023_PR_1 == 1] = 1
  cses3$vw[cses3$C1004=="BRA_2006" & cses3$C3023_PR_1 != 1] = 0
  cses3$vw[cses3$C1004=="BRA_2010" & cses3$C3023_PR_1 == 4] = 1
  cses3$vw[cses3$C1004=="BRA_2010" & cses3$C3023_PR_1 != 4] = 0
  cses3$vw[cses3$C1004=="CAN_2008" & cses3$C3023_LH_DC == 1] = 1
  cses3$vw[cses3$C1004=="CAN_2008" & cses3$C3023_LH_DC != 1] = 0
  cses3$vw[cses3$C1004=="CHL_2009" & cses3$C3023_LH_DC == 2] = 1
  cses3$vw[cses3$C1004=="CHL_2009" & cses3$C3023_LH_DC != 2] = 0
  cses3$vw[cses3$C1004=="HRV_2007" & cses3$C3023_LH_PL == 1] = 1
  cses3$vw[cses3$C1004=="HRV_2007" & cses3$C3023_LH_PL == 3] = 1
  cses3$vw[cses3$C1004=="HRV_2007" & cses3$C3023_LH_PL == 15] = 1
  cses3$vw[cses3$C1004=="HRV_2007" & cses3$C3023_LH_PL == 8] = 1
  cses3$vw[cses3$C1004=="HRV_2007" & cses3$C3023_LH_PL == 9] = 1
  cses3$vw[cses3$C1004=="HRV_2007" & cses3$C3023_LH_PL != 1 &
                 cses3$C3023_LH_PL != 3 & cses3$C3023_LH_PL != 15 & 
                 cses3$C3023_LH_PL != 8 & cses3$C3023_LH_PL != 9] = 0
  cses3$vw[cses3$C1004=="CZE_2006" & cses3$C3023_LH_PL == 8] = 1
  cses3$vw[cses3$C1004=="CZE_2006" & cses3$C3023_LH_PL == 23] = 1
  cses3$vw[cses3$C1004=="CZE_2006" & cses3$C3023_LH_PL == 17] = 1
  cses3$vw[cses3$C1004=="CZE_2006" & cses3$C3023_LH_PL != 17 &
                 cses3$C3023_LH_PL != 8 & cses3$C3023_LH_PL != 23] = 0
  cses3$vw[cses3$C1004=="CZE_2010" & cses3$C3023_LH_PL == 26] = 1
  cses3$vw[cses3$C1004=="CZE_2010" & cses3$C3023_LH_PL == 15] = 1
  cses3$vw[cses3$C1004=="CZE_2010" & cses3$C3023_LH_PL == 4] = 1
  cses3$vw[cses3$C1004=="CZE_2010" & cses3$C3023_LH_PL != 26 & 
                 cses3$C3023_LH_PL != 15 & cses3$C3023_LH_PL != 4] = 0
  cses3$vw[cses3$C1004=="CHE_2007" & cses3$C3023_LH_PL == 2] = 1
  cses3$vw[cses3$C1004=="CHE_2007" & cses3$C3023_LH_PL == 3] = 1
  cses3$vw[cses3$C1004=="CHE_2007" & cses3$C3023_LH_PL == 4] = 1
  cses3$vw[cses3$C1004=="CHE_2007" & cses3$C3023_LH_PL == 1] = 1
  cses3$vw[cses3$C1004=="CHE_2007" & cses3$C3023_LH_PL != 1 & 
                 cses3$C3023_LH_PL != 2 & cses3$C3023_LH_PL != 3 & 
                 cses3$C3023_LH_PL != 4] = 0
  cses3$vw[cses3$C1004=="DEU_2005" & cses3$C3023_LH_DC == 2] = 1
  cses3$vw[cses3$C1004=="DEU_2005" & cses3$C3023_LH_DC == 3] = 1
  cses3$vw[cses3$C1004=="DEU_2005" & cses3$C3023_LH_DC == 1] = 1
  cses3$vw[cses3$C1004=="DEU_2005" & cses3$C3023_LH_DC != 2 &
                 cses3$C3023_LH_DC != 3 & cses3$C3023_LH_DC != 1] = 0
  cses3$vw[cses3$C1004=="DEU_2009" & cses3$C3023_LH_DC == 2] = 1
  cses3$vw[cses3$C1004=="DEU_2009" & cses3$C3023_LH_DC == 4] = 1
  cses3$vw[cses3$C1004=="DEU_2009" & cses3$C3023_LH_DC == 1] = 1
  cses3$vw[cses3$C1004=="DEU_2009" & cses3$C3023_LH_DC != 2 &
                 cses3$C3023_LH_DC != 4 & cses3$C3023_LH_DC != 1] = 0
  cses3$vw[cses3$C1004=="DNK_2007" & cses3$C3023_LH_PL == 7] = 1
  cses3$vw[cses3$C1004=="DNK_2007" & cses3$C3023_LH_PL == 3] = 1
  cses3$vw[cses3$C1004=="DNK_2007" & cses3$C3023_LH_PL != 7 & 
                 cses3$C3023_LH_PL != 3] = 0
  cses3$vw[cses3$C1004=="ESP_2008" & cses3$C3023_LH_PL == 2] = 1
  cses3$vw[cses3$C1004=="ESP_2008" & cses3$C3023_LH_PL != 2] = 0
  cses3$vw[cses3$C1004=="EST_2011" & cses3$C3023_LH_DC == 2] = 1
  cses3$vw[cses3$C1004=="EST_2011" & cses3$C3023_LH_DC == 4] = 1
  cses3$vw[cses3$C1004=="EST_2011" & cses3$C3023_LH_DC != 2 &
                 cses3$C3023_LH_DC != 4] = 0
  cses3$vw[cses3$C1004=="FIN_2007" & cses3$C3023_LH_PL == 1] = 1
  cses3$vw[cses3$C1004=="FIN_2007" & cses3$C3023_LH_PL == 3] = 1
  cses3$vw[cses3$C1004=="FIN_2007" & cses3$C3023_LH_PL == 5] = 1
  cses3$vw[cses3$C1004=="FIN_2007" & cses3$C3023_LH_PL == 6] = 1
  cses3$vw[cses3$C1004=="FIN_2007" & cses3$C3023_LH_PL != 1 &
                 cses3$C3023_LH_PL != 3 & cses3$C3023_LH_PL != 5 & 
             cses3$C3023_LH_PL != 6] = 0
  cses3$vw[cses3$C1004=="FIN_2011" & cses3$C3023_LH_PL == 1] = 1
  cses3$vw[cses3$C1004=="FIN_2011" & cses3$C3023_LH_PL == 3] = 1
  cses3$vw[cses3$C1004=="FIN_2011" & cses3$C3023_LH_PL == 4] = 1
  cses3$vw[cses3$C1004=="FIN_2011" & cses3$C3023_LH_PL == 5] = 1
  cses3$vw[cses3$C1004=="FIN_2011" & cses3$C3023_LH_PL == 6] = 1
  cses3$vw[cses3$C1004=="FIN_2011" & cses3$C3023_LH_PL == 7] = 1
  cses3$vw[cses3$C1004=="FIN_2011" & cses3$C3023_LH_PL != 1 &
             cses3$C3023_LH_PL != 3 & cses3$C3023_LH_PL != 4 & 
             cses3$C3023_LH_PL != 5 & cses3$C3023_LH_PL != 6 & 
             cses3$C3023_LH_PL != 7] = 0
  cses3$vw[cses3$C1004=="FRA_2007" & cses3$C3023_LH_DC == 6] = 1
  cses3$vw[cses3$C1004=="FRA_2007" & cses3$C3023_LH_DC == 16] = 1
  cses3$vw[cses3$C1004=="FRA_2007" & cses3$C3023_LH_DC != 6 & 
                 cses3$C3023_LH_DC != 16] = 0
  cses3$vw[cses3$C1004=="GRC_2009" & cses3$C3023_LH_PL == 1] = 1
  cses3$vw[cses3$C1004=="GRC_2009" & cses3$C3023_LH_PL != 1] = 0
  cses3$vw[cses3$C1004=="IRL_2007" & cses3$C3023_LH_PL == 1] = 1
  cses3$vw[cses3$C1004=="IRL_2007" & cses3$C3023_LH_PL == 4] = 1
  cses3$vw[cses3$C1004=="IRL_2007" & cses3$C3023_LH_PL == 5] = 1
  cses3$vw[cses3$C1004=="IRL_2007" & cses3$C3023_LH_PL != 1 &
                 cses3$C3023_LH_PL != 4 & cses3$C3023_LH_PL != 5] = 0  
  cses3$vw[cses3$C1004=="ISL_2007" & cses3$C3023_LH_PL == 1] = 1
  cses3$vw[cses3$C1004=="ISL_2007" & cses3$C3023_LH_PL == 3] = 1
  cses3$vw[cses3$C1004=="ISL_2007" & cses3$C3023_LH_PL != 3 & 
                 cses3$C3023_LH_PL != 1] = 0
  cses3$vw[cses3$C1004=="ISL_2009" & cses3$C3023_LH_PL == 4] = 1
  cses3$vw[cses3$C1004=="ISL_2009" & cses3$C3023_LH_PL == 1] = 1
  cses3$vw[cses3$C1004=="ISL_2009" & cses3$C3023_LH_PL != 4 & 
                 cses3$C3023_LH_PL != 1] = 0
  cses3$vw[cses3$C1004=="ISR_2006" & cses3$C3023_LH_PL == 1] = 1
  cses3$vw[cses3$C1004=="ISR_2006" & cses3$C3023_LH_PL == 2] = 1
  cses3$vw[cses3$C1004=="ISR_2006" & cses3$C3023_LH_PL == 5] = 1
  cses3$vw[cses3$C1004=="ISR_2006" & cses3$C3023_LH_PL == 7] = 1
  cses3$vw[cses3$C1004=="ISR_2006" & cses3$C3023_LH_PL != 1 &
                 cses3$C3023_LH_PL != 2 & cses3$C3023_LH_PL != 5 & 
                 cses3$C3023_LH_PL != 7] = 0
  cses3$vw[cses3$C1004=="JPN_2007" & cses3$C3023_UH_PL == 3] = 1
  cses3$vw[cses3$C1004=="JPN_2007" & cses3$C3023_UH_PL == 1] = 1
  cses3$vw[cses3$C1004=="JPN_2007" & cses3$C3023_UH_PL != 3 & 
                 cses3$C3023_UH_PL != 1] = 0
  cses3$vw[cses3$C1004=="LVA_2010" & cses3$C3023_LH_DC == 3] = 1
  cses3$vw[cses3$C1004=="LVA_2010" & cses3$C3023_LH_DC == 2] = 1
  cses3$vw[cses3$C1004=="LVA_2010" & cses3$C3023_LH_DC != 3 & 
                 cses3$C3023_LH_DC != 2] = 0
  cses3$vw[cses3$C1004=="MEX_2006" & cses3$C3023_LH_DC == 5] = 1
  cses3$vw[cses3$C1004=="MEX_2006" & cses3$C3023_LH_DC == 1] = 1
  cses3$vw[cses3$C1004=="MEX_2006" & cses3$C3023_LH_DC != 5 & 
                 cses3$C3023_LH_DC != 1] = 0
  cses3$vw[cses3$C1004=="MEX_2009" & cses3$C3023_LH_DC == 2] = 1
  cses3$vw[cses3$C1004=="MEX_2009" & cses3$C3023_LH_DC != 2] = 0
  cses3$vw[cses3$C1004=="NLD_2006" & cses3$C3023_LH_PL == 2] = 1
  cses3$vw[cses3$C1004=="NLD_2006" & cses3$C3023_LH_PL == 1] = 1
  cses3$vw[cses3$C1004=="NLD_2006" & cses3$C3023_LH_PL == 7] = 1
  cses3$vw[cses3$C1004=="NLD_2006" & cses3$C3023_LH_PL != 2 &
                 cses3$C3023_LH_PL != 1 & cses3$C3023_LH_PL != 7] = 0
  cses3$vw[cses3$C1004=="NLD_2010" & cses3$C3023_LH_PL == 1] = 1
  cses3$vw[cses3$C1004=="NLD_2010" & cses3$C3023_LH_PL == 4] = 1
  cses3$vw[cses3$C1004=="NLD_2010" & cses3$C3023_LH_PL != 1 & 
                 cses3$C3023_LH_PL != 4] = 0
  cses3$vw[cses3$C1004== 'NZL_2008' & cses3$C3023_LH_DC == 1] = 1
  cses3$vw[cses3$C1004== 'NZL_2008' & cses3$C3023_LH_DC != 1] = 0
  cses3$vw[cses3$C1004=="NOR_2005" & cses3$C3023_LH_PL == 2] = 1
  cses3$vw[cses3$C1004=="NOR_2005" & cses3$C3023_LH_PL == 3] = 1
  cses3$vw[cses3$C1004=="NOR_2005" & cses3$C3023_LH_PL == 6] = 1
  cses3$vw[cses3$C1004=="NOR_2005" & cses3$C3023_LH_PL != 2 &
                 cses3$C3023_LH_PL != 3 & cses3$C3023_LH_PL != 6] = 0
  cses3$vw[cses3$C1004=="NOR_2009" & cses3$C3023_LH_PL == 2] = 1
  cses3$vw[cses3$C1004=="NOR_2009" & cses3$C3023_LH_PL == 3] = 1
  cses3$vw[cses3$C1004=="NOR_2009" & cses3$C3023_LH_PL == 6] = 1
  cses3$vw[cses3$C1004=="NOR_2009" & cses3$C3023_LH_PL != 2 &
                 cses3$C3023_LH_PL != 3 & cses3$C3023_LH_PL != 6] = 0   
  cses3$vw[cses3$C1004== 'PER_2011' & cses3$C3023_PR_1 == 1] = 1
  cses3$vw[cses3$C1004== 'PER_2011' & cses3$C3023_PR_1 != 1] = 0
  cses3$vw[cses3$C1004== 'PHL_2010' & cses3$C3023_PR_1 == 2] = 1
  cses3$vw[cses3$C1004== 'PHL_2010' & cses3$C3023_PR_1 == 32] = 1
  cses3$vw[cses3$C1004== 'PHL_2010' & cses3$C3023_PR_1 != 32 &
                 cses3$C3023_PR_1 != 2] = 0
  cses3$vw[cses3$C1004=="POL_2005" & cses3$C3023_LH_PL == 6] = 1
  cses3$vw[cses3$C1004=="POL_2005" & cses3$C3023_LH_PL == 11] = 1
  cses3$vw[cses3$C1004=="POL_2005" & cses3$C3023_LH_PL != 6 &
                 cses3$C3023_LH_PL != 11] = 0
  cses3$vw[cses3$C1004=="POL_2007" & cses3$C3023_LH_PL == 6] = 1
  cses3$vw[cses3$C1004=="POL_2007" & cses3$C3023_LH_PL == 8] = 1
  cses3$vw[cses3$C1004=="POL_2007" & cses3$C3023_LH_PL != 6 & 
                 cses3$C3023_LH_PL != 8] = 0
  cses3$vw[cses3$C1004== 'PRT_2009' & cses3$C3023_LH_PL == 5] = 1
  cses3$vw[cses3$C1004== 'PRT_2009' & cses3$C3023_LH_PL != 5] = 0
  cses3$vw[cses3$C1004== 'ROU_2009' & cses3$C3023_PR_1 == 1] = 1
  cses3$vw[cses3$C1004== 'ROU_2009' & cses3$C3023_PR_1 == 5] = 1
  cses3$vw[cses3$C1004== 'ROU_2009' & cses3$C3023_PR_1 != 1 & 
                 cses3$C3023_PR_1 != 5] = 0
  cses3$vw[cses3$C1004== 'SVK_2010' & cses3$C3023_LH_PL == 4] = 1
  cses3$vw[cses3$C1004== 'SVK_2010' & cses3$C3023_LH_PL == 7] = 1
  cses3$vw[cses3$C1004== 'SVK_2010' & cses3$C3023_LH_PL == 10] = 1
  cses3$vw[cses3$C1004== 'SVK_2010' & cses3$C3023_LH_PL == 11] = 1
  cses3$vw[cses3$C1004== 'SVK_2010' & cses3$C3023_LH_PL != 4 & 
                 cses3$C3023_LH_PL != 7 & cses3$C3023_LH_PL != 10 & 
                 cses3$C3023_LH_PL != 11] = 0
  cses3$vw[cses3$C1004== 'SVN_2008' & cses3$C3023_LH_PL == 1] = 1
  cses3$vw[cses3$C1004== 'SVN_2008' & cses3$C3023_LH_PL == 2] = 1
  cses3$vw[cses3$C1004== 'SVN_2008' & cses3$C3023_LH_PL == 7] = 1
  cses3$vw[cses3$C1004== 'SVN_2008' & cses3$C3023_LH_PL == 8] = 1
  cses3$vw[cses3$C1004== 'SVN_2008' & cses3$C3023_LH_PL != 1 &
                 cses3$C3023_LH_PL != 2 & cses3$C3023_LH_PL != 7 & 
                 cses3$C3023_LH_PL != 8] = 0
  cses3$vw[cses3$C1004=="KOR_2008" & cses3$C3023_LH_DC == 2] = 1
  cses3$vw[cses3$C1004=="KOR_2008" & cses3$C3023_LH_DC != 2] = 0
  cses3$vw[cses3$C1004== 'ZAF_2009' & cses3$C3023_LH_PL == 1] = 1
  cses3$vw[cses3$C1004== 'ZAF_2009' & cses3$C3023_LH_PL != 1] = 0
  cses3$vw[cses3$C1004== 'SWE_2006' & cses3$C3023_LH_PL == 6] = 1
  cses3$vw[cses3$C1004== 'SWE_2006' & cses3$C3023_LH_PL == 3] = 1
  cses3$vw[cses3$C1004== 'SWE_2006' & cses3$C3023_LH_PL == 4] = 1
  cses3$vw[cses3$C1004== 'SWE_2006' & cses3$C3023_LH_PL == 5] = 1
  cses3$vw[cses3$C1004== 'SWE_2006' & cses3$C3023_LH_PL != 4 &
                 cses3$C3023_LH_PL != 6 & cses3$C3023_LH_PL != 3 & 
                 cses3$C3023_LH_PL != 4 & cses3$C3023_LH_PL != 5] = 0
  cses3$vw[cses3$C1004=="THA_2007" & cses3$C3023_LH_DC == 1] = 1
  cses3$vw[cses3$C1004=="THA_2007" & cses3$C3023_LH_DC == 4] = 1
  cses3$vw[cses3$C1004=="THA_2007" & cses3$C3023_LH_DC == 3] = 1
  cses3$vw[cses3$C1004=="THA_2007" & cses3$C3023_LH_DC == 5] = 1
  cses3$vw[cses3$C1004=="THA_2007" & cses3$C3023_LH_DC == 6] = 1
  cses3$vw[cses3$C1004=="THA_2007" & cses3$C3023_LH_DC == 7] = 1
  cses3$vw[cses3$C1004=="THA_2007" & cses3$C3023_LH_DC != 1 &
                 cses3$C3023_LH_DC != 4 & cses3$C3023_LH_DC != 3 & 
                 cses3$C3023_LH_DC != 5 & cses3$C3023_LH_DC != 6 & 
                 cses3$C3023_LH_DC != 7] = 0
  cses3$vw[cses3$C1004== 'TUR_2011' & cses3$C3023_LH_PL == 1] = 1
  cses3$vw[cses3$C1004== 'TUR_2011' & cses3$C3023_LH_PL != 1] = 0
  cses3$vw[cses3$C1004== 'USA_2008' & cses3$C3023_PR_1 == 1] = 1
  cses3$vw[cses3$C1004== 'USA_2008' & cses3$C3023_PR_1 != 1] = 0
  cses3$vw[cses3$C1004== 'URY_2009' & cses3$C3023_PR_1 == 3] = 1
  cses3$vw[cses3$C1004== 'URY_2009' & cses3$C3023_PR_1 != 3] = 0
  cses3$vw <- ifelse(cses3$C3021_1 > 1, -1, cses3$vw) #-1 are non-voters (answered other than "R cast a ballot")
table(cses3$vw)

cses3$vw <- factor(cses3$vw, levels=c("0", "1", "-1")) #sets loser as reference category
@

<<ideological distance from disliked party>>=
#party they dislike the most
cses3$leastliked <- colnames(cses3[85:93])[max.col(-cses3[85:93],ties.method="first")]
table(cses3$leastliked)

#expert position for least liked party
cses3$leastlikedpos <- 999
cses3$leastlikedpos <- ifelse(cses3$leastliked == "C3009_A", cses3$C5017_A, cses3$leastlikedpos)
cses3$leastlikedpos <- ifelse(cses3$leastliked == "C3009_B", cses3$C5017_B, cses3$leastlikedpos)
cses3$leastlikedpos <- ifelse(cses3$leastliked == "C3009_C", cses3$C5017_C, cses3$leastlikedpos)
cses3$leastlikedpos <- ifelse(cses3$leastliked == "C3009_D", cses3$C5017_D, cses3$leastlikedpos)
cses3$leastlikedpos <- ifelse(cses3$leastliked == "C3009_E", cses3$C5017_E, cses3$leastlikedpos)
cses3$leastlikedpos <- ifelse(cses3$leastliked == "C3009_F", cses3$C5017_F, cses3$leastlikedpos)
cses3$leastlikedpos <- ifelse(cses3$leastliked == "C3009_G", cses3$C5017_G, cses3$leastlikedpos)
cses3$leastlikedpos <- ifelse(cses3$leastliked == "C3009_H", cses3$C5017_H, cses3$leastlikedpos)
cses3$leastlikedpos <- ifelse(cses3$leastliked == "C3009_I", cses3$C5017_I, cses3$leastlikedpos)
#respondent distance from that party
cses3$ideo <- abs(cses3$C3013 - cses3$leastlikedpos)
cses3$ideo <- ifelse(cses3$leastlikedpos == 99, NA, cses3$ideo) #remove cases where the party position was not evaluated
table(cses3$C1004, cses3$ideo)
@

<<never>>=
#make a variable for if they would never vote for the party that became PM for the lower house or president (first three mentions)
cses3$never <- 0
cses3$never[cses3$C1004 == 'AUS_2007' & cses3$C3030_LH_1 == 2] = 1
cses3$never[cses3$C1004 == 'AUS_2007' & cses3$C3030_LH_2 == 2] = 1
cses3$never[cses3$C1004 == 'AUT_2008' & cses3$C3030_LH_1 == 1] = 1
cses3$never[cses3$C1004 == 'BRA_2006' & (cses3$C3030_LH_1 == 1 | cses3$C3030_PR_1 == 1)] = 1
cses3$never[cses3$C1004 == 'BRA_2010' & (cses3$C3030_LH_1 == 4 | cses3$C3030_PR_1 == 4)] = 1
cses3$never[cses3$C1004 == 'BRA_2010' & (cses3$C3030_LH_2 == 4 | cses3$C3030_PR_2 == 4)] = 1
cses3$never[cses3$C1004 == 'CAN_2008' & cses3$C3030_LH_1 == 1] = 1
cses3$never[cses3$C1004 == 'CHL_2009' & cses3$C3030_LH_1 == 2] = 1
cses3$never[cses3$C1004 == 'CHE_2007' & cses3$C3030_LH_1 == 4] = 1
cses3$never[cses3$C1004 == 'HRV_2007' & cses3$C3030_LH_1 == 1] = 1
cses3$never[cses3$C1004 == 'HRV_2007' & cses3$C3030_LH_2 == 1] = 1
cses3$never[cses3$C1004 == 'HRV_2007' & cses3$C3030_LH_2 == 1] = 1
cses3$never[cses3$C1004 == 'CZE_2006' & cses3$C3030_LH_1 == 8] = 1
cses3$never[cses3$C1004 == 'CZE_2006' & cses3$C3030_LH_2 == 8] = 1
cses3$never[cses3$C1004 == 'CZE_2006' & cses3$C3030_LH_3 == 8] = 1
cses3$never[cses3$C1004 == 'CZE_2010' & cses3$C3030_LH_1 == 26] = 1
cses3$never[cses3$C1004 == 'CZE_2010' & cses3$C3030_LH_2 == 26] = 1
cses3$never[cses3$C1004 == 'CZE_2010' & cses3$C3030_LH_3 == 26] = 1
cses3$never[cses3$C1004 == 'DNK_2007' & cses3$C3030_LH_1 == 7] = 1
cses3$never[cses3$C1004 == 'DNK_2007' & cses3$C3030_LH_2 == 7] = 1
cses3$never[cses3$C1004 == 'DNK_2007' & cses3$C3030_LH_3 == 7] = 1
cses3$never[cses3$C1004 == 'EST_2011' & cses3$C3030_LH_1 == 4] = 1
cses3$never[cses3$C1004 == 'EST_2011' & cses3$C3030_LH_2 == 4] = 1
cses3$never[cses3$C1004 == 'EST_2011' & cses3$C3030_LH_3 == 4] = 1
cses3$never[cses3$C1004 == 'ESP_2008' & cses3$C3030_LH_1 == 2] = 1
cses3$never[cses3$C1004 == 'DEU_2005' & cses3$C3030_LH_1 == 1] = 1
cses3$never[cses3$C1004 == 'DEU_2009' & cses3$C3030_LH_1 == 1] = 1
cses3$never[cses3$C1004 == 'DEU_2009' & cses3$C3030_LH_2 == 1] = 1
cses3$never[cses3$C1004 == 'DEU_2009' & cses3$C3030_LH_3 == 1] = 1
cses3$never[cses3$C1004 == 'FIN_2007' & cses3$C3030_LH_1 == 1] = 1
cses3$never[cses3$C1004 == 'FIN_2011' & cses3$C3030_LH_1 == 3] = 1
cses3$never[cses3$C1004 == 'FIN_2011' & cses3$C3030_LH_2 == 3] = 1
cses3$never[cses3$C1004 == 'FIN_2011' & cses3$C3030_LH_2 == 3] = 1
cses3$never[cses3$C1004 == 'FRA_2007' & cses3$C3030_LH_1 == 6] = 1
cses3$never[cses3$C1004 == 'GRC_2009' & cses3$C3030_LH_1 == 1] = 1
cses3$never[cses3$C1004 == 'GRC_2009' & cses3$C3030_LH_2 == 1] = 1
cses3$never[cses3$C1004 == 'GRC_2009' & cses3$C3030_LH_3 == 1] = 1
cses3$never[cses3$C1004 == 'HRV_2007' & cses3$C3030_LH_1 == 1] = 1
cses3$never[cses3$C1004 == 'HRV_2007' & cses3$C3030_LH_2 == 1] = 1
cses3$never[cses3$C1004 == 'HRV_2007' & cses3$C3030_LH_3 == 1] = 1
cses3$never[cses3$C1004 == 'ISL_2007' & cses3$C3030_LH_1 == 3] = 1
cses3$never[cses3$C1004 == 'ISL_2007' & cses3$C3030_LH_2 == 3] = 1
cses3$never[cses3$C1004 == 'ISL_2007' & cses3$C3030_LH_3 == 3] = 1
cses3$never[cses3$C1004 == 'ISL_2009' & cses3$C3030_LH_1 == 1] = 1
cses3$never[cses3$C1004 == 'ISL_2009' & cses3$C3030_LH_2 == 1] = 1
cses3$never[cses3$C1004 == 'ISL_2009' & cses3$C3030_LH_2 == 1] = 1
cses3$never[cses3$C1004 == 'IRL_2007' & cses3$C3030_LH_1 == 1] = 1
cses3$never[cses3$C1004 == 'ISR_2006' & cses3$C3030_LH_1 == 1] = 1
cses3$never[cses3$C1004 == 'ISR_2006' & cses3$C3030_LH_2 == 1] = 1
cses3$never[cses3$C1004 == 'ISR_2006' & cses3$C3030_LH_3 == 1] = 1
cses3$never[cses3$C1004 == 'JPN_2007' & cses3$C3030_UH_1 == 1] = 1
cses3$never[cses3$C1004 == 'KOR_2008' & cses3$C3030_LH_1 == 2] = 1
cses3$never[cses3$C1004 == 'LVA_2010' & cses3$C3030_LH_1 == 2] = 1
cses3$never[cses3$C1004 == 'LVA_2010' & cses3$C3030_LH_2 == 2] = 1
cses3$never[cses3$C1004 == 'MEX_2006' & (cses3$C3030_LH_1 == 1 | cses3$C3030_PR_1 == 1)] = 1
cses3$never[cses3$C1004 == 'MEX_2006' & (cses3$C3030_LH_2 == 1 | cses3$C3030_PR_2 == 1)] = 1
cses3$never[cses3$C1004 == 'MEX_2006' & (cses3$C3030_LH_3 == 1 | cses3$C3030_PR_3 == 1)] = 1
cses3$never[cses3$C1004 == 'MEX_2009' & cses3$C3030_LH_1 == 2] = 1
cses3$never[cses3$C1004 == 'MEX_2009' & cses3$C3030_LH_2 == 2] = 1
cses3$never[cses3$C1004 == 'MEX_2009' & cses3$C3030_LH_3 == 2] = 1
cses3$never[cses3$C1004 == 'NLD_2006' & cses3$C3030_LH_1 == 1] = 1
cses3$never[cses3$C1004 == 'NLD_2010' & cses3$C3030_LH_1 == 1] = 1
cses3$never[cses3$C1004 == 'NOR_2005' & cses3$C3030_LH_1 == 3] = 1
cses3$never[cses3$C1004 == 'NOR_2009' & cses3$C3030_LH_1 == 3] = 1
cses3$never[cses3$C1004 == 'NZL_2008' & cses3$C3030_LH_1 == 1] = 1
cses3$never[cses3$C1004 == 'PER_2011' & (cses3$C3030_LH_1 == 1 | cses3$C3030_PR_1 == 1)] = 1
cses3$never[cses3$C1004 == 'PER_2011' & (cses3$C3030_LH_2 == 1 | cses3$C3030_PR_2 == 1)] = 1
cses3$never[cses3$C1004 == 'PHL_2010' & (cses3$C3030_LH_1 == 2 | cses3$C3030_PR_1 == 2)] = 1
cses3$never[cses3$C1004 == 'POL_2005' & cses3$C3030_LH_1 == 6] = 1
cses3$never[cses3$C1004 == 'POL_2005' & cses3$C3030_LH_2 == 6] = 1
cses3$never[cses3$C1004 == 'POL_2005' & cses3$C3030_LH_3 == 6] = 1
cses3$never[cses3$C1004 == 'POL_2007' & cses3$C3030_LH_1 == 6] = 1
cses3$never[cses3$C1004 == 'POL_2007' & cses3$C3030_LH_2 == 6] = 1
cses3$never[cses3$C1004 == 'POL_2007' & cses3$C3030_LH_3 == 6] = 1
cses3$never[cses3$C1004 == 'PRT_2009' & cses3$C3030_LH_1 == 5] = 1
cses3$never[cses3$C1004 == 'PRT_2009' & cses3$C3030_LH_2 == 5] = 1
cses3$never[cses3$C1004 == 'PRT_2009' & cses3$C3030_LH_2 == 5] = 1
cses3$never[cses3$C1004 == 'ROU_2009' & (cses3$C3030_LH_1 == 1 | cses3$C3030_PR_1 == 1)] = 1
cses3$never[cses3$C1004 == 'ROU_2009' & (cses3$C3030_LH_2 == 1 | cses3$C3030_PR_2 == 1)] = 1
cses3$never[cses3$C1004 == 'ROU_2009' & (cses3$C3030_LH_3 == 1 | cses3$C3030_PR_3 == 1)] = 1
cses3$never[cses3$C1004 == 'SVK_2010' & cses3$C3030_LH_1 == 11] = 1
cses3$never[cses3$C1004 == 'SVK_2010' & cses3$C3030_LH_2 == 11] = 1
cses3$never[cses3$C1004 == 'SVK_2010' & cses3$C3030_LH_3 == 11] = 1
cses3$never[cses3$C1004 == 'SVN_2008' & cses3$C3030_LH_1 == 7] = 1
cses3$never[cses3$C1004 == 'ZAF_2009' & cses3$C3030_LH_1 == 1] = 1
cses3$never[cses3$C1004 == 'SWE_2006' & cses3$C3030_LH_1 == 5] = 1
cses3$never[cses3$C1004 == 'SWE_2006' & cses3$C3030_LH_2 == 5] = 1
cses3$never[cses3$C1004 == 'SWE_2006' & cses3$C3030_LH_3 == 5] = 1
cses3$never[cses3$C1004 == 'THA_2007' & cses3$C3030_LH_1 == 1] = 1
cses3$never[cses3$C1004 == 'TUR_2011' & cses3$C3030_LH_1 == 1] = 1
cses3$never[cses3$C1004 == 'TUR_2011' & cses3$C3030_LH_2 == 1] = 1
cses3$never[cses3$C1004 == 'TUR_2011' & cses3$C3030_LH_3 == 1] = 1
cses3$never[cses3$C1004 == 'USA_2008' & (cses3$C3030_LH_1 == 1 | cses3$C3030_PR_1 == 1)] = 1
cses3$never[cses3$C1004 == 'USA_2008' & (cses3$C3030_LH_2 == 1 | cses3$C3030_PR_2 == 1)] = 1
cses3$never[cses3$C1004 == 'URY_2009' & (cses3$C3030_LH_1 == 1 | cses3$C3030_PR_1 == 1)] = 1
table(cses3$never)

###subset dataset for countries asked "ARE THERE OTHERS FOR WHICH R WOULD NEVER VOTE"
never_cses3 <- subset(cses3, cses3$C1004 != 'CHL_2009'& cses3$C1004 != 'FRA_2007'& cses3$C1004 != 'NOR_2005' & cses3$C1004 != 'KOR_2008' & cses3$C1004 != 'URY_2009') #plus taiwan but already dropped
###recode ARE THERE OTHERS FOR WHICH R WOULD NEVER VOTE, LOWER HOUSE/PRESIDENT/UPPER HOUSE
never_cses3 <- subset(never_cses3, never_cses3$C3029_LH < 6 | never_cses3$C3029_PR < 6 | never_cses3$C3029_UH < 6) #some countries skipped this question or skipped it for non-voters
never_cses3$neverparty <- ifelse(never_cses3$C3029_LH == 1 | never_cses3$C3029_PR == 1 | never_cses3$C3029_UH == 1, 1, 0) #anyparty would never vote

never_cses3$dislike <- ifelse(never_cses3$C3009_A<5 | never_cses3$C3009_B<5 |never_cses3$C3009_C<5 |never_cses3$C3009_D<5 | never_cses3$C3009_E<5|never_cses3$C3009_F<5|never_cses3$C3009_G<5|never_cses3$C3009_H<5|never_cses3$C3009_I<5, 1, 0)
table(never_cses3$neverparty)
@

<<joint coding>>=
#uses top three mentions of parties if available; uses parties rates 0-10; where asked of PR included

cses3$nm <- 0
cses3$nm[cses3$C1004 == 'AUS_2007' & cses3$C3030_LH_1 == 1 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'AUS_2007' & cses3$C3030_LH_1 == 2 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'AUS_2007' & cses3$C3030_LH_1 == 3 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'AUS_2007' & cses3$C3030_LH_1 == 4 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'AUS_2007' & cses3$C3030_LH_2 == 2 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'AUS_2007' & cses3$C3030_LH_2 == 3 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'AUS_2007' & cses3$C3030_LH_2 == 4 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'AUS_2007' & cses3$C3030_LH_3 == 3 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'AUS_2007' & cses3$C3030_LH_3 == 4 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'AUT_2008' & cses3$C3030_LH_1 == 1 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'AUT_2008' & cses3$C3030_LH_1 == 2 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'AUT_2008' & cses3$C3030_LH_1 == 3 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'AUT_2008' & cses3$C3030_LH_1 == 4 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'AUT_2008' & cses3$C3030_LH_1 == 6 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'AUT_2008' & cses3$C3030_LH_1 == 7 & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'BRA_2006' & (cses3$C3030_LH_1 == 1 | cses3$C3030_PR_1 == 1) & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'BRA_2006' & (cses3$C3030_LH_1 == 2 | cses3$C3030_PR_1 == 2) & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'BRA_2006' & (cses3$C3030_LH_1 == 3 | cses3$C3030_PR_1 == 3) & cses3$C3009_I < 5] = 1
cses3$nm[cses3$C1004 == 'BRA_2006' & (cses3$C3030_LH_1 == 4 | cses3$C3030_PR_1 == 4) & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'BRA_2006' & (cses3$C3030_LH_1 == 6 | cses3$C3030_PR_1 == 6) & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'BRA_2006' & (cses3$C3030_LH_1 == 9 | cses3$C3030_PR_1 == 9) & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'BRA_2006' & (cses3$C3030_LH_1 == 7 | cses3$C3030_PR_1 == 7) & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'BRA_2006' & (cses3$C3030_LH_1 == 8 | cses3$C3030_PR_1 == 8) & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'BRA_2010' & (cses3$C3030_LH_1 == 1 | cses3$C3030_PR_1 == 1) & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'BRA_2010' & (cses3$C3030_LH_1 == 2 | cses3$C3030_PR_1 == 2) & cses3$C3009_I < 5] = 1
cses3$nm[cses3$C1004 == 'BRA_2010' & (cses3$C3030_LH_1 == 3 | cses3$C3030_PR_1 == 3) & cses3$C3009_H < 5] = 1
cses3$nm[cses3$C1004 == 'BRA_2010' & (cses3$C3030_LH_1 == 4 | cses3$C3030_PR_1 == 4) & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'BRA_2010' & (cses3$C3030_LH_1 == 5 | cses3$C3030_PR_1 == 5) & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'BRA_2010' & (cses3$C3030_LH_1 == 7 | cses3$C3030_PR_1 == 7) & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'BRA_2010' & (cses3$C3030_LH_1 == 8 | cses3$C3030_PR_1 == 8) & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'BRA_2010' & (cses3$C3030_LH_2 == 1 | cses3$C3030_PR_1 == 1) & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'BRA_2010' & (cses3$C3030_LH_2 == 2 | cses3$C3030_PR_1 == 2) & cses3$C3009_I < 5] = 1
cses3$nm[cses3$C1004 == 'BRA_2010' & (cses3$C3030_LH_2 == 3 | cses3$C3030_PR_1 == 3) & cses3$C3009_H < 5] = 1
cses3$nm[cses3$C1004 == 'BRA_2010' & (cses3$C3030_LH_2 == 4 | cses3$C3030_PR_1 == 4) & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'BRA_2010' & (cses3$C3030_LH_2 == 5 | cses3$C3030_PR_1 == 5) & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'BRA_2010' & (cses3$C3030_LH_2 == 7 | cses3$C3030_PR_1 == 7) & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'BRA_2010' & (cses3$C3030_LH_2 == 8 | cses3$C3030_PR_1 == 8) & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'CAN_2008' & cses3$C3030_LH_1 == 1 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'CAN_2008' & cses3$C3030_LH_1 == 2 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'CAN_2008' & cses3$C3030_LH_1 == 3 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'CAN_2008' & cses3$C3030_LH_1 == 4 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'CAN_2008' & cses3$C3030_LH_1 == 5 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'CHE_2007' & cses3$C3030_LH_1 == 1 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'CHE_2007' & cses3$C3030_LH_1 == 2 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'CHE_2007' & cses3$C3030_LH_1 == 3 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'CHE_2007' & cses3$C3030_LH_1 == 4 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'CHE_2007' & cses3$C3030_LH_1 == 5 & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'CHE_2007' & cses3$C3030_LH_1 == 6 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'CHE_2007' & cses3$C3030_LH_1 == 10 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'CHE_2007' & cses3$C3030_LH_1 == 15 & cses3$C3009_H < 5] = 1
cses3$nm[cses3$C1004 == 'CHE_2007' & cses3$C3030_LH_2 == 1 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'CHE_2007' & cses3$C3030_LH_2 == 2 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'CHE_2007' & cses3$C3030_LH_2 == 3 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'CHE_2007' & cses3$C3030_LH_2 == 4 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'CHE_2007' & cses3$C3030_LH_2 == 5 & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'CHE_2007' & cses3$C3030_LH_2 == 6 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'CHE_2007' & cses3$C3030_LH_2 == 10 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'CHE_2007' & cses3$C3030_LH_2 == 15 & cses3$C3009_H < 5] = 1
cses3$nm[cses3$C1004 == 'CHE_2007' & cses3$C3030_LH_3 == 1 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'CHE_2007' & cses3$C3030_LH_3 == 2 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'CHE_2007' & cses3$C3030_LH_3 == 3 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'CHE_2007' & cses3$C3030_LH_3 == 4 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'CHE_2007' & cses3$C3030_LH_3 == 5 & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'CHE_2007' & cses3$C3030_LH_3 == 6 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'CHE_2007' & cses3$C3030_LH_3 == 10 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'CHE_2007' & cses3$C3030_LH_3 == 15 & cses3$C3009_H < 5] = 1
cses3$nm[cses3$C1004 == 'CZE_2006' & cses3$C3030_LH_1 == 8 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'CZE_2006' & cses3$C3030_LH_1 == 9 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'CZE_2006' & cses3$C3030_LH_1 == 17 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'CZE_2006' & cses3$C3030_LH_1 == 19 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'CZE_2006' & cses3$C3030_LH_1 == 23 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'CZE_2006' & cses3$C3030_LH_2 == 8 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'CZE_2006' & cses3$C3030_LH_2 == 9 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'CZE_2006' & cses3$C3030_LH_2 == 17 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'CZE_2006' & cses3$C3030_LH_2 == 19 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'CZE_2006' & cses3$C3030_LH_2 == 23 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'CZE_2006' & cses3$C3030_LH_3 == 8 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'CZE_2006' & cses3$C3030_LH_3 == 9 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'CZE_2006' & cses3$C3030_LH_3 == 17 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'CZE_2006' & cses3$C3030_LH_3 == 19 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'CZE_2006' & cses3$C3030_LH_3 == 23 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'CZE_2010' & cses3$C3030_LH_1 == 4 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'CZE_2010' & cses3$C3030_LH_1 == 6 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'CZE_2010' & cses3$C3030_LH_1 == 9 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'CZE_2010' & cses3$C3030_LH_1 == 15 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'CZE_2010' & cses3$C3030_LH_1 == 17 & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'CZE_2010' & cses3$C3030_LH_1 == 20 & cses3$C3009_H < 5] = 1
cses3$nm[cses3$C1004 == 'CZE_2010' & cses3$C3030_LH_1 == 26 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'CZE_2010' & cses3$C3030_LH_2 == 4 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'CZE_2010' & cses3$C3030_LH_2 == 6 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'CZE_2010' & cses3$C3030_LH_2 == 9 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'CZE_2010' & cses3$C3030_LH_2 == 15 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'CZE_2010' & cses3$C3030_LH_2 == 17 & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'CZE_2010' & cses3$C3030_LH_2 == 20 & cses3$C3009_H < 5] = 1
cses3$nm[cses3$C1004 == 'CZE_2010' & cses3$C3030_LH_2 == 26 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'CZE_2010' & cses3$C3030_LH_3 == 4 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'CZE_2010' & cses3$C3030_LH_3 == 6 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'CZE_2010' & cses3$C3030_LH_3 == 9 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'CZE_2010' & cses3$C3030_LH_3 == 15 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'CZE_2010' & cses3$C3030_LH_3 == 17 & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'CZE_2010' & cses3$C3030_LH_3 == 20 & cses3$C3009_H < 5] = 1
cses3$nm[cses3$C1004 == 'CZE_2010' & cses3$C3030_LH_3 == 26 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'DEU_2005' & cses3$C3030_LH_1 == 1 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'DEU_2005' & cses3$C3030_LH_1 == 2 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'DEU_2005' & cses3$C3030_LH_1 == 3 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'DEU_2005' & cses3$C3030_LH_1 == 4 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'DEU_2005' & cses3$C3030_LH_1 == 5 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'DEU_2005' & cses3$C3030_LH_1 == 6 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'DEU_2005' & cses3$C3030_LH_1 == 8 & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'DEU_2005' & cses3$C3030_LH_2 == 1 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'DEU_2005' & cses3$C3030_LH_2 == 2 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'DEU_2005' & cses3$C3030_LH_2 == 3 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'DEU_2005' & cses3$C3030_LH_2 == 4 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'DEU_2005' & cses3$C3030_LH_2 == 5 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'DEU_2005' & cses3$C3030_LH_2 == 6 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'DEU_2005' & cses3$C3030_LH_2 == 8 & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'DEU_2005' & cses3$C3030_LH_3 == 1 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'DEU_2005' & cses3$C3030_LH_3 == 2 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'DEU_2005' & cses3$C3030_LH_3 == 3 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'DEU_2005' & cses3$C3030_LH_3 == 4 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'DEU_2005' & cses3$C3030_LH_3 == 5 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'DEU_2005' & cses3$C3030_LH_3 == 6 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'DEU_2005' & cses3$C3030_LH_3 == 8 & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'DEU_2009' & cses3$C3030_LH_1 == 1 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'DEU_2009' & cses3$C3030_LH_1 == 2 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'DEU_2009' & cses3$C3030_LH_1 == 3 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'DEU_2009' & cses3$C3030_LH_1 == 4 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'DEU_2009' & cses3$C3030_LH_1 == 5 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'DEU_2009' & cses3$C3030_LH_1 == 6 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'DEU_2009' & cses3$C3030_LH_1 == 7 & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'DEU_2009' & cses3$C3030_LH_2 == 1 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'DEU_2009' & cses3$C3030_LH_2 == 2 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'DEU_2009' & cses3$C3030_LH_2 == 3 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'DEU_2009' & cses3$C3030_LH_2 == 4 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'DEU_2009' & cses3$C3030_LH_2 == 5 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'DEU_2009' & cses3$C3030_LH_2 == 6 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'DEU_2009' & cses3$C3030_LH_2 == 7 & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'DEU_2009' & cses3$C3030_LH_3 == 1 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'DEU_2009' & cses3$C3030_LH_3 == 2 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'DEU_2009' & cses3$C3030_LH_3 == 3 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'DEU_2009' & cses3$C3030_LH_3 == 4 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'DEU_2009' & cses3$C3030_LH_3 == 5 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'DEU_2009' & cses3$C3030_LH_3 == 6 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'DEU_2009' & cses3$C3030_LH_3 == 7 & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'DNK_2007' & cses3$C3030_LH_1 == 1 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'DNK_2007' & cses3$C3030_LH_1 == 2 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'DNK_2007' & cses3$C3030_LH_1 == 3 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'DNK_2007' & cses3$C3030_LH_1 == 4 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'DNK_2007' & cses3$C3030_LH_1 == 5 & cses3$C3009_I < 5] = 1
cses3$nm[cses3$C1004 == 'DNK_2007' & cses3$C3030_LH_1 == 6 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'DNK_2007' & cses3$C3030_LH_1 == 7 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'DNK_2007' & cses3$C3030_LH_1 == 8 & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'DNK_2007' & cses3$C3030_LH_1 == 9 & cses3$C3009_H < 5] = 1
cses3$nm[cses3$C1004 == 'DNK_2007' & cses3$C3030_LH_2 == 1 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'DNK_2007' & cses3$C3030_LH_2 == 2 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'DNK_2007' & cses3$C3030_LH_2 == 3 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'DNK_2007' & cses3$C3030_LH_2 == 4 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'DNK_2007' & cses3$C3030_LH_2 == 5 & cses3$C3009_I < 5] = 1
cses3$nm[cses3$C1004 == 'DNK_2007' & cses3$C3030_LH_2 == 6 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'DNK_2007' & cses3$C3030_LH_2== 7 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'DNK_2007' & cses3$C3030_LH_2 == 8 & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'DNK_2007' & cses3$C3030_LH_2 == 9 & cses3$C3009_H < 5] = 1
cses3$nm[cses3$C1004 == 'DNK_2007' & cses3$C3030_LH_3 == 1 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'DNK_2007' & cses3$C3030_LH_3 == 2 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'DNK_2007' & cses3$C3030_LH_3 == 3 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'DNK_2007' & cses3$C3030_LH_3 == 4 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'DNK_2007' & cses3$C3030_LH_3 == 5 & cses3$C3009_I < 5] = 1
cses3$nm[cses3$C1004 == 'DNK_2007' & cses3$C3030_LH_3 == 6 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'DNK_2007' & cses3$C3030_LH_3 == 7 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'DNK_2007' & cses3$C3030_LH_3 == 8 & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'DNK_2007' & cses3$C3030_LH_3 == 9 & cses3$C3009_H < 5] = 1
cses3$nm[cses3$C1004 == 'ESP_2008' & cses3$C3030_LH_1 == 1 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'ESP_2008' & cses3$C3030_LH_1 == 2 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'ESP_2008' & cses3$C3030_LH_1 == 3 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'ESP_2008' & cses3$C3030_LH_1 == 4 & cses3$C3009_I < 5] = 1
cses3$nm[cses3$C1004 == 'ESP_2008' & cses3$C3030_LH_1 == 5 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'ESP_2008' & cses3$C3030_LH_1 == 6 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'ESP_2008' & cses3$C3030_LH_1 == 7 & cses3$C3009_H < 5] = 1
cses3$nm[cses3$C1004 == 'ESP_2008' & cses3$C3030_LH_1 == 8 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'ESP_2008' & cses3$C3030_LH_1 == 9 & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'ESP_2008' & cses3$C3030_LH_2 == 1 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'ESP_2008' & cses3$C3030_LH_2 == 2 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'ESP_2008' & cses3$C3030_LH_2 == 3 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'ESP_2008' & cses3$C3030_LH_2 == 4 & cses3$C3009_I < 5] = 1
cses3$nm[cses3$C1004 == 'ESP_2008' & cses3$C3030_LH_2 == 5 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'ESP_2008' & cses3$C3030_LH_2 == 6 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'ESP_2008' & cses3$C3030_LH_2 == 7 & cses3$C3009_H < 5] = 1
cses3$nm[cses3$C1004 == 'ESP_2008' & cses3$C3030_LH_2 == 8 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'ESP_2008' & cses3$C3030_LH_2 == 9 & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'ESP_2008' & cses3$C3030_LH_3 == 1 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'ESP_2008' & cses3$C3030_LH_3 == 2 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'ESP_2008' & cses3$C3030_LH_3 == 3 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'ESP_2008' & cses3$C3030_LH_3 == 4 & cses3$C3009_I < 5] = 1
cses3$nm[cses3$C1004 == 'ESP_2008' & cses3$C3030_LH_3 == 5 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'ESP_2008' & cses3$C3030_LH_3 == 6 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'ESP_2008' & cses3$C3030_LH_3 == 7 & cses3$C3009_H < 5] = 1
cses3$nm[cses3$C1004 == 'ESP_2008' & cses3$C3030_LH_3 == 8 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'ESP_2008' & cses3$C3030_LH_3 == 9 & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'EST_2011' & cses3$C3030_LH_1 == 1 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'EST_2011' & cses3$C3030_LH_1 == 2 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'EST_2011' & cses3$C3030_LH_1 == 3 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'EST_2011' & cses3$C3030_LH_1 == 4 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'EST_2011' & cses3$C3030_LH_1 == 5 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'EST_2011' & cses3$C3030_LH_1 == 8 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'EST_2011' & cses3$C3030_LH_2 == 1 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'EST_2011' & cses3$C3030_LH_2 == 2 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'EST_2011' & cses3$C3030_LH_2 == 3 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'EST_2011' & cses3$C3030_LH_2 == 4 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'EST_2011' & cses3$C3030_LH_2 == 5 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'EST_2011' & cses3$C3030_LH_2 == 8 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'EST_2011' & cses3$C3030_LH_3 == 1 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'EST_2011' & cses3$C3030_LH_3 == 2 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'EST_2011' & cses3$C3030_LH_3 == 3 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'EST_2011' & cses3$C3030_LH_3 == 4 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'EST_2011' & cses3$C3030_LH_3 == 5 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'EST_2011' & cses3$C3030_LH_3 == 8 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'FIN_2007' & cses3$C3030_LH_1 == 1 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'FIN_2007' & cses3$C3030_LH_1 == 2 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'FIN_2007' & cses3$C3030_LH_1 == 3 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'FIN_2007' & cses3$C3030_LH_1 == 4 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'FIN_2007' & cses3$C3030_LH_1 == 5 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'FIN_2007' & cses3$C3030_LH_1 == 6 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'FIN_2007' & cses3$C3030_LH_1 == 7 & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'FIN_2007' & cses3$C3030_LH_1 == 8 & cses3$C3009_H < 5] = 1
cses3$nm[cses3$C1004 == 'FIN_2007' & cses3$C3030_LH_2 == 1 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'FIN_2007' & cses3$C3030_LH_2 == 2 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'FIN_2007' & cses3$C3030_LH_2 == 3 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'FIN_2007' & cses3$C3030_LH_2 == 4 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'FIN_2007' & cses3$C3030_LH_2 == 5 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'FIN_2007' & cses3$C3030_LH_2 == 6 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'FIN_2007' & cses3$C3030_LH_2 == 7 & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'FIN_2007' & cses3$C3030_LH_2 == 8 & cses3$C3009_H < 5] = 1
cses3$nm[cses3$C1004 == 'FIN_2007' & cses3$C3030_LH_3 == 1 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'FIN_2007' & cses3$C3030_LH_3 == 2 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'FIN_2007' & cses3$C3030_LH_3 == 3 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'FIN_2007' & cses3$C3030_LH_3 == 4 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'FIN_2007' & cses3$C3030_LH_3 == 5 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'FIN_2007' & cses3$C3030_LH_3 == 6 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'FIN_2007' & cses3$C3030_LH_3 == 7 & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'FIN_2007' & cses3$C3030_LH_3 == 8 & cses3$C3009_H < 5] = 1
cses3$nm[cses3$C1004 == 'FIN_2011' & cses3$C3030_LH_1 == 1 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'FIN_2011' & cses3$C3030_LH_1 == 2 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'FIN_2011' & cses3$C3030_LH_1 == 3 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'FIN_2011' & cses3$C3030_LH_1 == 4 & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'FIN_2011' & cses3$C3030_LH_1 == 5 & cses3$C3009_H < 5] = 1
cses3$nm[cses3$C1004 == 'FIN_2011' & cses3$C3030_LH_1 == 6 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'FIN_2011' & cses3$C3030_LH_1 == 7 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'FIN_2011' & cses3$C3030_LH_1 == 8 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'FIN_2011' & cses3$C3030_LH_2 == 1 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'FIN_2011' & cses3$C3030_LH_2 == 2 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'FIN_2011' & cses3$C3030_LH_2 == 3 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'FIN_2011' & cses3$C3030_LH_2 == 4 & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'FIN_2011' & cses3$C3030_LH_2 == 5 & cses3$C3009_H < 5] = 1
cses3$nm[cses3$C1004 == 'FIN_2011' & cses3$C3030_LH_2 == 6 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'FIN_2011' & cses3$C3030_LH_2 == 7 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'FIN_2011' & cses3$C3030_LH_2 == 8 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'FIN_2011' & cses3$C3030_LH_3 == 1 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'FIN_2011' & cses3$C3030_LH_3 == 2 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'FIN_2011' & cses3$C3030_LH_3 == 3 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'FIN_2011' & cses3$C3030_LH_3 == 4 & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'FIN_2011' & cses3$C3030_LH_3 == 5 & cses3$C3009_H < 5] = 1
cses3$nm[cses3$C1004 == 'FIN_2011' & cses3$C3030_LH_3 == 6 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'FIN_2011' & cses3$C3030_LH_3 == 7 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'FIN_2011' & cses3$C3030_LH_3 == 8 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'FRA_2007' & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'FRA_2007' & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'FRA_2007' & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'FRA_2007' & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'FRA_2007' & cses3$C3009_c < 5] = 1
cses3$nm[cses3$C1004 == 'FRA_2007' & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'FRA_2007' & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'GRC_2009' & cses3$C3030_LH_1 == 1 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'GRC_2009' & cses3$C3030_LH_1 == 2 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'GRC_2009' & cses3$C3030_LH_1 == 3 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'GRC_2009' & cses3$C3030_LH_1 == 4 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'GRC_2009' & cses3$C3030_LH_1 == 5 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'GRC_2009' & cses3$C3030_LH_1 == 6 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'GRC_2009' & cses3$C3030_LH_2 == 1 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'GRC_2009' & cses3$C3030_LH_2 == 2 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'GRC_2009' & cses3$C3030_LH_2 == 3 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'GRC_2009' & cses3$C3030_LH_2 == 4 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'GRC_2009' & cses3$C3030_LH_2 == 5 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'GRC_2009' & cses3$C3030_LH_2 == 6 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'GRC_2009' & cses3$C3030_LH_3 == 1 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'GRC_2009' & cses3$C3030_LH_3 == 2 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'GRC_2009' & cses3$C3030_LH_3 == 3 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'GRC_2009' & cses3$C3030_LH_3 == 4 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'GRC_2009' & cses3$C3030_LH_3 == 5 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'GRC_2009' & cses3$C3030_LH_3 == 6 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'HRV_2007' & cses3$C3030_LH_1 == 1 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'HRV_2007' & cses3$C3030_LH_1 == 2 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'HRV_2007' & cses3$C3030_LH_1 == 3 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'HRV_2007' & cses3$C3030_LH_1 == 4 & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'HRV_2007' & cses3$C3030_LH_1 == 5 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'HRV_2007' & cses3$C3030_LH_1 == 6 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'HRV_2007' & cses3$C3030_LH_1 == 7 & cses3$C3009_H < 5] = 1
cses3$nm[cses3$C1004 == 'HRV_2007' & cses3$C3030_LH_1 == 8 & cses3$C3009_I < 5] = 1
cses3$nm[cses3$C1004 == 'HRV_2007' & cses3$C3030_LH_1 == 10 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'HRV_2007' & cses3$C3030_LH_2 == 1 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'HRV_2007' & cses3$C3030_LH_2 == 2 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'HRV_2007' & cses3$C3030_LH_2 == 3 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'HRV_2007' & cses3$C3030_LH_2 == 4 & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'HRV_2007' & cses3$C3030_LH_2 == 5 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'HRV_2007' & cses3$C3030_LH_2 == 6 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'HRV_2007' & cses3$C3030_LH_2 == 7 & cses3$C3009_H < 5] = 1
cses3$nm[cses3$C1004 == 'HRV_2007' & cses3$C3030_LH_2 == 8 & cses3$C3009_I < 5] = 1
cses3$nm[cses3$C1004 == 'HRV_2007' & cses3$C3030_LH_2 == 10 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'HRV_2007' & cses3$C3030_LH_3 == 1 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'HRV_2007' & cses3$C3030_LH_3 == 2 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'HRV_2007' & cses3$C3030_LH_3 == 3 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'HRV_2007' & cses3$C3030_LH_3 == 4 & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'HRV_2007' & cses3$C3030_LH_3 == 5 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'HRV_2007' & cses3$C3030_LH_3 == 6 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'HRV_2007' & cses3$C3030_LH_3 == 7 & cses3$C3009_H < 5] = 1
cses3$nm[cses3$C1004 == 'HRV_2007' & cses3$C3030_LH_3 == 8 & cses3$C3009_I < 5] = 1
cses3$nm[cses3$C1004 == 'HRV_2007' & cses3$C3030_LH_3 == 10 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'IRL_2007' & cses3$C3030_LH_1 == 1 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'IRL_2007' & cses3$C3030_LH_1 == 2 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'IRL_2007' & cses3$C3030_LH_1 == 3 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'IRL_2007' & cses3$C3030_LH_1 == 4 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'IRL_2007' & cses3$C3030_LH_1 == 5 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'IRL_2007' & cses3$C3030_LH_1 == 6 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'ISL_2007' & cses3$C3030_LH_1 == 1 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'ISL_2007' & cses3$C3030_LH_1 == 2 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'ISL_2007' & cses3$C3030_LH_1 == 3 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'ISL_2007' & cses3$C3030_LH_1 == 4 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'ISL_2007' & cses3$C3030_LH_1 == 5 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'ISL_2007' & cses3$C3030_LH_1 == 6 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'ISL_2007' & cses3$C3030_LH_2 == 1 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'ISL_2007' & cses3$C3030_LH_2 == 2 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'ISL_2007' & cses3$C3030_LH_2 == 3 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'ISL_2007' & cses3$C3030_LH_2 == 4 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'ISL_2007' & cses3$C3030_LH_2 == 5 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'ISL_2007' & cses3$C3030_LH_2 == 6 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'ISL_2007' & cses3$C3030_LH_3 == 1 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'ISL_2007' & cses3$C3030_LH_3 == 2 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'ISL_2007' & cses3$C3030_LH_3 == 3 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'ISL_2007' & cses3$C3030_LH_3 == 4 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'ISL_2007' & cses3$C3030_LH_3 == 5 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'ISL_2007' & cses3$C3030_LH_3 == 6 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'ISL_2009' & cses3$C3030_LH_1 == 1 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'ISL_2009' & cses3$C3030_LH_1 == 2 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'ISL_2009' & cses3$C3030_LH_1 == 3 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'ISL_2009' & cses3$C3030_LH_1 == 4 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'ISL_2009' & cses3$C3030_LH_1 == 5 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'ISL_2009' & cses3$C3030_LH_1 == 6 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'ISR_2006' & cses3$C3030_LH_1 == 1 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'ISR_2006' & cses3$C3030_LH_1 == 2 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'ISR_2006' & cses3$C3030_LH_1 == 3 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'ISR_2006' & cses3$C3030_LH_1 == 4 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'ISR_2006' & cses3$C3030_LH_1 == 5 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'ISR_2006' & cses3$C3030_LH_1 == 7 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'ISR_2006' & cses3$C3030_LH_2 == 1 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'ISR_2006' & cses3$C3030_LH_2 == 2 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'ISR_2006' & cses3$C3030_LH_2 == 3 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'ISR_2006' & cses3$C3030_LH_2 == 4 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'ISR_2006' & cses3$C3030_LH_2 == 5 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'ISR_2006' & cses3$C3030_LH_2 == 7 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'ISR_2006' & cses3$C3030_LH_3 == 1 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'ISR_2006' & cses3$C3030_LH_3 == 2 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'ISR_2006' & cses3$C3030_LH_3 == 3 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'ISR_2006' & cses3$C3030_LH_3 == 4 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'ISR_2006' & cses3$C3030_LH_3 == 5 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'ISR_2006' & cses3$C3030_LH_3 == 7 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'JPN_2007' & cses3$C3030_UH_1 == 1 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'JPN_2007' & cses3$C3030_UH_1 == 2 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'JPN_2007' & cses3$C3030_UH_1 == 3 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'JPN_2007' & cses3$C3030_UH_1 == 4 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'JPN_2007' & cses3$C3030_UH_1 == 5 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'JPN_2007' & cses3$C3030_UH_2 == 1 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'JPN_2007' & cses3$C3030_UH_2 == 2 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'JPN_2007' & cses3$C3030_UH_2 == 3 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'JPN_2007' & cses3$C3030_UH_2 == 4 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'JPN_2007' & cses3$C3030_UH_2 == 5 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'JPN_2007' & cses3$C3030_UH_3 == 1 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'JPN_2007' & cses3$C3030_UH_3 == 2 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'JPN_2007' & cses3$C3030_UH_3 == 3 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'JPN_2007' & cses3$C3030_UH_3 == 4 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'JPN_2007' & cses3$C3030_UH_3 == 5 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'KOR_2008' & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'KOR_2008' & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'KOR_2008' & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'KOR_2008' & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'KOR_2008' & cses3$C3009_c < 5] = 1
cses3$nm[cses3$C1004 == 'KOR_2008' & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'KOR_2008' & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'MEX_2006' & (cses3$C3030_LH_1 == 1 | cses3$C3030_PR_1 == 1) & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'MEX_2006' & (cses3$C3030_LH_1 == 2 | cses3$C3030_PR_1 == 2) & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'MEX_2006' & (cses3$C3030_LH_1 == 3 | cses3$C3030_PR_1 == 3) & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'MEX_2006' & (cses3$C3030_LH_1 == 4 | cses3$C3030_PR_1 == 4) & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'MEX_2006' & (cses3$C3030_LH_1 == 5 | cses3$C3030_PR_1 == 5) & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'MEX_2006' & (cses3$C3030_LH_1 == 6 | cses3$C3030_PR_1 == 6) & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'MEX_2006' & (cses3$C3030_LH_1 == 7 | cses3$C3030_PR_1 == 7) & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'MEX_2006' & (cses3$C3030_LH_1 == 8 | cses3$C3030_PR_1 == 8) & cses3$C3009_H < 5] = 1
cses3$nm[cses3$C1004 == 'MEX_2006' & (cses3$C3030_LH_2 == 1 | cses3$C3030_PR_1 == 1) & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'MEX_2006' & (cses3$C3030_LH_2 == 2 | cses3$C3030_PR_1 == 2) & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'MEX_2006' & (cses3$C3030_LH_2 == 3 | cses3$C3030_PR_1 == 3) & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'MEX_2006' & (cses3$C3030_LH_2 == 4 | cses3$C3030_PR_1 == 4) & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'MEX_2006' & (cses3$C3030_LH_2 == 5 | cses3$C3030_PR_1 == 5) & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'MEX_2006' & (cses3$C3030_LH_2 == 6 | cses3$C3030_PR_1 == 6) & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'MEX_2006' & (cses3$C3030_LH_2 == 7 | cses3$C3030_PR_1 == 7) & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'MEX_2006' & (cses3$C3030_LH_2 == 8 | cses3$C3030_PR_1 == 8) & cses3$C3009_H < 5] = 1
cses3$nm[cses3$C1004 == 'MEX_2006' & (cses3$C3030_LH_3 == 1 | cses3$C3030_PR_1 == 1) & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'MEX_2006' & (cses3$C3030_LH_3 == 2 | cses3$C3030_PR_1 == 2) & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'MEX_2006' & (cses3$C3030_LH_3 == 3 | cses3$C3030_PR_1 == 3) & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'MEX_2006' & (cses3$C3030_LH_3 == 4 | cses3$C3030_PR_1 == 4) & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'MEX_2006' & (cses3$C3030_LH_3 == 5 | cses3$C3030_PR_1 == 5) & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'MEX_2006' & (cses3$C3030_LH_3 == 6 | cses3$C3030_PR_1 == 6) & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'MEX_2006' & (cses3$C3030_LH_3 == 7 | cses3$C3030_PR_1 == 7) & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'MEX_2006' & (cses3$C3030_LH_3 == 8 | cses3$C3030_PR_1 == 8) & cses3$C3009_H < 5] = 1
cses3$nm[cses3$C1004 == 'MEX_2009' & cses3$C3030_LH_1 == 1 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'MEX_2009' & cses3$C3030_LH_1 == 2 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'MEX_2009' & cses3$C3030_LH_1 == 3 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'MEX_2009' & cses3$C3030_LH_1 == 4 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'MEX_2009' & cses3$C3030_LH_1 == 5 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'MEX_2009' & cses3$C3030_LH_1 == 6 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'MEX_2009' & cses3$C3030_LH_1 == 7 & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'MEX_2009' & cses3$C3030_LH_1 == 8 & cses3$C3009_H < 5] = 1
cses3$nm[cses3$C1004 == 'MEX_2009' & cses3$C3030_LH_2 == 1 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'MEX_2009' & cses3$C3030_LH_2 == 2 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'MEX_2009' & cses3$C3030_LH_2 == 3 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'MEX_2009' & cses3$C3030_LH_2 == 4 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'MEX_2009' & cses3$C3030_LH_2 == 5 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'MEX_2009' & cses3$C3030_LH_2 == 6 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'MEX_2009' & cses3$C3030_LH_2 == 7 & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'MEX_2009' & cses3$C3030_LH_2 == 8 & cses3$C3009_H < 5] = 1
cses3$nm[cses3$C1004 == 'MEX_2009' & cses3$C3030_LH_3 == 1 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'MEX_2009' & cses3$C3030_LH_3 == 2 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'MEX_2009' & cses3$C3030_LH_3 == 3 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'MEX_2009' & cses3$C3030_LH_3 == 4 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'MEX_2009' & cses3$C3030_LH_3 == 5 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'MEX_2009' & cses3$C3030_LH_3 == 6 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'MEX_2009' & cses3$C3030_LH_3 == 7 & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'MEX_2009' & cses3$C3030_LH_3 == 8 & cses3$C3009_H < 5] = 1
cses3$nm[cses3$C1004 == 'NLD_2006' & cses3$C3030_LH_1 == 1 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'NLD_2006' & cses3$C3030_LH_1 == 2 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'NLD_2006' & cses3$C3030_LH_1 == 3 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'NLD_2006' & cses3$C3030_LH_1 == 4 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'NLD_2006' & cses3$C3030_LH_1 == 5 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'NLD_2006' & cses3$C3030_LH_1 == 6 & cses3$C3009_H < 5] = 1
cses3$nm[cses3$C1004 == 'NLD_2006' & cses3$C3030_LH_1 == 7 & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'NLD_2006' & cses3$C3030_LH_1 == 8 & cses3$C3009_I < 5] = 1
cses3$nm[cses3$C1004 == 'NLD_2006' & cses3$C3030_LH_1 == 13 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'NLD_2006' & cses3$C3030_LH_2 == 1 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'NLD_2006' & cses3$C3030_LH_2 == 2 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'NLD_2006' & cses3$C3030_LH_2 == 3 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'NLD_2006' & cses3$C3030_LH_2 == 4 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'NLD_2006' & cses3$C3030_LH_2 == 5 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'NLD_2006' & cses3$C3030_LH_2 == 6 & cses3$C3009_H < 5] = 1
cses3$nm[cses3$C1004 == 'NLD_2006' & cses3$C3030_LH_2 == 7 & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'NLD_2006' & cses3$C3030_LH_2 == 8 & cses3$C3009_I < 5] = 1
cses3$nm[cses3$C1004 == 'NLD_2006' & cses3$C3030_LH_2 == 13 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'NLD_2006' & cses3$C3030_LH_3 == 1 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'NLD_2006' & cses3$C3030_LH_3 == 2 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'NLD_2006' & cses3$C3030_LH_3 == 3 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'NLD_2006' & cses3$C3030_LH_3 == 4 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'NLD_2006' & cses3$C3030_LH_3 == 5 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'NLD_2006' & cses3$C3030_LH_3 == 6 & cses3$C3009_H < 5] = 1
cses3$nm[cses3$C1004 == 'NLD_2006' & cses3$C3030_LH_3 == 7 & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'NLD_2006' & cses3$C3030_LH_3 == 8 & cses3$C3009_I < 5] = 1
cses3$nm[cses3$C1004 == 'NLD_2006' & cses3$C3030_LH_3 == 13 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'NLD_2010' & cses3$C3030_LH_1 == 1 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'NLD_2010' & cses3$C3030_LH_1 == 2 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'NLD_2010' & cses3$C3030_LH_1 == 3 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'NLD_2010' & cses3$C3030_LH_1 == 4 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'NLD_2010' & cses3$C3030_LH_1 == 5 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'NLD_2010' & cses3$C3030_LH_1 == 6 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'NLD_2010' & cses3$C3030_LH_1 == 7 & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'NLD_2010' & cses3$C3030_LH_1 == 8 & cses3$C3009_H < 5] = 1
cses3$nm[cses3$C1004 == 'NLD_2010' & cses3$C3030_LH_1 == 9 & cses3$C3009_I < 5] = 1
cses3$nm[cses3$C1004 == 'NLD_2010' & cses3$C3030_LH_2 == 1 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'NLD_2010' & cses3$C3030_LH_2 == 2 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'NLD_2010' & cses3$C3030_LH_2 == 3 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'NLD_2010' & cses3$C3030_LH_2 == 4 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'NLD_2010' & cses3$C3030_LH_2 == 5 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'NLD_2010' & cses3$C3030_LH_2 == 6 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'NLD_2010' & cses3$C3030_LH_2 == 7 & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'NLD_2010' & cses3$C3030_LH_2 == 8 & cses3$C3009_H < 5] = 1
cses3$nm[cses3$C1004 == 'NLD_2010' & cses3$C3030_LH_2 == 9 & cses3$C3009_I < 5] = 1
cses3$nm[cses3$C1004 == 'NLD_2010' & cses3$C3030_LH_3 == 1 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'NLD_2010' & cses3$C3030_LH_3 == 2 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'NLD_2010' & cses3$C3030_LH_3 == 3 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'NLD_2010' & cses3$C3030_LH_3 == 4 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'NLD_2010' & cses3$C3030_LH_3 == 5 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'NLD_2010' & cses3$C3030_LH_3 == 6 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'NLD_2010' & cses3$C3030_LH_3 == 7 & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'NLD_2010' & cses3$C3030_LH_3 == 8 & cses3$C3009_H < 5] = 1
cses3$nm[cses3$C1004 == 'NLD_2010' & cses3$C3030_LH_3 == 9 & cses3$C3009_I < 5] = 1
cses3$nm[cses3$C1004 == 'NOR_2005' & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'NOR_2005' & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'NOR_2005' & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'NOR_2005' & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'NOR_2005' & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'NOR_2005' & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'NOR_2005' & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'NOR_2005' & cses3$C3009_H < 5] = 1
cses3$nm[cses3$C1004 == 'NOR_2009' & cses3$C3030_LH_1 == 1 & cses3$C3009_H < 5] = 1
cses3$nm[cses3$C1004 == 'NOR_2009' & cses3$C3030_LH_1 == 2 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'NOR_2009' & cses3$C3030_LH_1 == 3 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'NOR_2009' & cses3$C3030_LH_1 == 4 & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'NOR_2009' & cses3$C3030_LH_1 == 5 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'NOR_2009' & cses3$C3030_LH_1 == 6 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'NOR_2009' & cses3$C3030_LH_1 == 7 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'NOR_2009' & cses3$C3030_LH_1 == 8 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'NOR_2009' & cses3$C3030_LH_2 == 1 & cses3$C3009_H < 5] = 1
cses3$nm[cses3$C1004 == 'NOR_2009' & cses3$C3030_LH_2 == 2 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'NOR_2009' & cses3$C3030_LH_2 == 3 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'NOR_2009' & cses3$C3030_LH_2 == 4 & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'NOR_2009' & cses3$C3030_LH_2 == 5 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'NOR_2009' & cses3$C3030_LH_2 == 6 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'NOR_2009' & cses3$C3030_LH_2 == 7 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'NOR_2009' & cses3$C3030_LH_2 == 8 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'NOR_2009' & cses3$C3030_LH_3 == 1 & cses3$C3009_H < 5] = 1
cses3$nm[cses3$C1004 == 'NOR_2009' & cses3$C3030_LH_3 == 2 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'NOR_2009' & cses3$C3030_LH_3 == 3 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'NOR_2009' & cses3$C3030_LH_3 == 4 & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'NOR_2009' & cses3$C3030_LH_3 == 5 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'NOR_2009' & cses3$C3030_LH_3 == 6 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'NOR_2009' & cses3$C3030_LH_3 == 7 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'NOR_2009' & cses3$C3030_LH_3 == 8 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'NZL_2008' & cses3$C3030_LH_1 == 1 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'NZL_2008' & cses3$C3030_LH_1 == 2 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'NZL_2008' & cses3$C3030_LH_1 == 3 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'NZL_2008' & cses3$C3030_LH_1 == 4 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'NZL_2008' & cses3$C3030_LH_1 == 5 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'NZL_2008' & cses3$C3030_LH_1 == 6 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'NZL_2008' & cses3$C3030_LH_1 == 7 & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'NZL_2008' & cses3$C3030_LH_1 == 8 & cses3$C3009_H < 5] = 1
cses3$nm[cses3$C1004 == 'NZL_2008' & cses3$C3030_LH_2 == 1 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'NZL_2008' & cses3$C3030_LH_2 == 2 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'NZL_2008' & cses3$C3030_LH_2 == 3 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'NZL_2008' & cses3$C3030_LH_2 == 4 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'NZL_2008' & cses3$C3030_LH_2 == 5 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'NZL_2008' & cses3$C3030_LH_2 == 6 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'NZL_2008' & cses3$C3030_LH_2 == 7 & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'NZL_2008' & cses3$C3030_LH_2 == 8 & cses3$C3009_H < 5] = 1
cses3$nm[cses3$C1004 == 'NZL_2008' & cses3$C3030_LH_3 == 1 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'NZL_2008' & cses3$C3030_LH_3 == 2 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'NZL_2008' & cses3$C3030_LH_3 == 3 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'NZL_2008' & cses3$C3030_LH_3 == 4 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'NZL_2008' & cses3$C3030_LH_3 == 5 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'NZL_2008' & cses3$C3030_LH_3 == 6 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'NZL_2008' & cses3$C3030_LH_3 == 7 & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'NZL_2008' & cses3$C3030_LH_3 == 8 & cses3$C3009_H < 5] = 1
cses3$nm[cses3$C1004 == 'PER_2011' & (cses3$C3030_LH_1 == 1 | cses3$C3030_PR_1 == 1) & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'PER_2011' & (cses3$C3030_LH_1 == 2 | cses3$C3030_PR_1 == 2) & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'PER_2011' & (cses3$C3030_LH_1 == 3 | cses3$C3030_PR_1 == 3) & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'PER_2011' & (cses3$C3030_LH_1 == 4 | cses3$C3030_PR_1 == 4) & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'PER_2011' & (cses3$C3030_LH_1 == 5 | cses3$C3030_PR_1 == 5) & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'PER_2011' & (cses3$C3030_LH_1 == 6 | cses3$C3030_PR_1 == 6) & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'PHL_2010' & (cses3$C3030_LH_1 == 1 | cses3$C3030_PR_1 == 1) & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'PHL_2010' & (cses3$C3030_LH_1 == 2 | cses3$C3030_PR_1 == 2) & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'PHL_2010' & (cses3$C3030_LH_1 == 4 | cses3$C3030_PR_1 == 4) & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'PHL_2010' & (cses3$C3030_LH_1 == 5 | cses3$C3030_PR_1 == 5) & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'PHL_2010' & (cses3$C3030_LH_1 == 9 | cses3$C3030_PR_1 == 9) & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'PHL_2010' & (cses3$C3030_LH_1 == 7 | cses3$C3030_PR_1 == 7) & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'PHL_2010' & (cses3$C3030_LH_1 == 8 | cses3$C3030_PR_1 == 8) & cses3$C3009_I < 5] = 1
cses3$nm[cses3$C1004 == 'PHL_2010' & (cses3$C3030_LH_1 == 87 | cses3$C3030_PR_1 == 87) & cses3$C3009_H < 5] = 1
cses3$nm[cses3$C1004 == 'PHL_2010' & (cses3$C3030_LH_1 == 88 | cses3$C3030_PR_1 == 88) & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'POL_2005' & cses3$C3030_LH_1 == 3 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'POL_2005' & cses3$C3030_LH_1 == 4 & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'POL_2005' & cses3$C3030_LH_1 == 5 & cses3$C3009_H < 5] = 1
cses3$nm[cses3$C1004 == 'POL_2005' & cses3$C3030_LH_1 == 6 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'POL_2005' & cses3$C3030_LH_1 == 7 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'POL_2005' & cses3$C3030_LH_1 == 8 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'POL_2005' & cses3$C3030_LH_1 == 10 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'POL_2005' & cses3$C3030_LH_1 == 15 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'POL_2005' & cses3$C3030_LH_2 == 3 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'POL_2005' & cses3$C3030_LH_2 == 4 & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'POL_2005' & cses3$C3030_LH_2 == 5 & cses3$C3009_H < 5] = 1
cses3$nm[cses3$C1004 == 'POL_2005' & cses3$C3030_LH_2 == 6 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'POL_2005' & cses3$C3030_LH_2 == 7 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'POL_2005' & cses3$C3030_LH_2 == 8 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'POL_2005' & cses3$C3030_LH_2 == 10 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'POL_2005' & cses3$C3030_LH_2 == 15 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'POL_2005' & cses3$C3030_LH_3 == 3 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'POL_2005' & cses3$C3030_LH_3 == 4 & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'POL_2005' & cses3$C3030_LH_3 == 5 & cses3$C3009_H < 5] = 1
cses3$nm[cses3$C1004 == 'POL_2005' & cses3$C3030_LH_3 == 6 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'POL_2005' & cses3$C3030_LH_3 == 7 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'POL_2005' & cses3$C3030_LH_3 == 8 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'POL_2005' & cses3$C3030_LH_3 == 10 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'POL_2005' & cses3$C3030_LH_3 == 15 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'POL_2007' & cses3$C3030_LH_1 == 4 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'POL_2007' & cses3$C3030_LH_1 == 6 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'POL_2007' & cses3$C3030_LH_1 == 8 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'POL_2007' & cses3$C3030_LH_1 == 9 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'POL_2007' & cses3$C3030_LH_2 == 4 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'POL_2007' & cses3$C3030_LH_2 == 6 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'POL_2007' & cses3$C3030_LH_2 == 8 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'POL_2007' & cses3$C3030_LH_2 == 9 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'POL_2007' & cses3$C3030_LH_3 == 4 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'POL_2007' & cses3$C3030_LH_3 == 6 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'POL_2007' & cses3$C3030_LH_3 == 8 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'POL_2007' & cses3$C3030_LH_3 == 9 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'PRT_2009' & cses3$C3030_LH_1 == 1 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'PRT_2009' & cses3$C3030_LH_1 == 2 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'PRT_2009' & cses3$C3030_LH_1 == 3 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'PRT_2009' & cses3$C3030_LH_1 == 4 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'PRT_2009' & cses3$C3030_LH_1 == 5 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'PRT_2009' & cses3$C3030_LH_2 == 1 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'PRT_2009' & cses3$C3030_LH_2 == 2 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'PRT_2009' & cses3$C3030_LH_2 == 3 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'PRT_2009' & cses3$C3030_LH_2 == 4 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'PRT_2009' & cses3$C3030_LH_2 == 5 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'PRT_2009' & cses3$C3030_LH_3 == 1 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'PRT_2009' & cses3$C3030_LH_3 == 2 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'PRT_2009' & cses3$C3030_LH_3 == 3 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'PRT_2009' & cses3$C3030_LH_3 == 4 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'PRT_2009' & cses3$C3030_LH_3 == 5 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'ROU_2009' & (cses3$C3030_LH_1 == 1 | cses3$C3030_PR_1 == 1) & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'ROU_2009' & (cses3$C3030_LH_1 == 2 | cses3$C3030_PR_1 == 2) & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'ROU_2009' & (cses3$C3030_LH_1 == 3 | cses3$C3030_PR_1 == 3) & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'ROU_2009' & (cses3$C3030_LH_1 == 4 | cses3$C3030_PR_1 == 4) & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'ROU_2009' & (cses3$C3030_LH_1 == 5 | cses3$C3030_PR_1 == 5) & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'ROU_2009' & (cses3$C3030_LH_1 == 6 | cses3$C3030_PR_1 == 6) & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'ROU_2009' & (cses3$C3030_LH_1 == 89 | cses3$C3030_PR_1 == 89) & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'SVK_2010' & cses3$C3030_LH_1 == 4 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'SVK_2010' & cses3$C3030_LH_1 == 5 & cses3$C3009_H < 5] = 1
cses3$nm[cses3$C1004 == 'SVK_2010' & cses3$C3030_LH_1 == 7 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'SVK_2010' & cses3$C3030_LH_1 == 10 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'SVK_2010' & cses3$C3030_LH_1 == 11 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'SVK_2010' & cses3$C3030_LH_1 == 12 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'SVK_2010' & cses3$C3030_LH_1 == 13 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'SVK_2010' & cses3$C3030_LH_1 == 14 & cses3$C3009_I < 5] = 1
cses3$nm[cses3$C1004 == 'SVK_2010' & cses3$C3030_LH_1 == 15 & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'SVK_2010' & cses3$C3030_LH_2 == 4 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'SVK_2010' & cses3$C3030_LH_2 == 5 & cses3$C3009_H < 5] = 1
cses3$nm[cses3$C1004 == 'SVK_2010' & cses3$C3030_LH_2 == 7 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'SVK_2010' & cses3$C3030_LH_2 == 10 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'SVK_2010' & cses3$C3030_LH_2 == 11 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'SVK_2010' & cses3$C3030_LH_2 == 12 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'SVK_2010' & cses3$C3030_LH_2 == 13 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'SVK_2010' & cses3$C3030_LH_2 == 14 & cses3$C3009_I < 5] = 1
cses3$nm[cses3$C1004 == 'SVK_2010' & cses3$C3030_LH_2 == 15 & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'SVK_2010' & cses3$C3030_LH_3 == 4 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'SVK_2010' & cses3$C3030_LH_3 == 5 & cses3$C3009_H < 5] = 1
cses3$nm[cses3$C1004 == 'SVK_2010' & cses3$C3030_LH_3 == 7 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'SVK_2010' & cses3$C3030_LH_3 == 10 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'SVK_2010' & cses3$C3030_LH_3 == 11 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'SVK_2010' & cses3$C3030_LH_3 == 12 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'SVK_2010' & cses3$C3030_LH_3 == 13 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'SVK_2010' & cses3$C3030_LH_3 == 14 & cses3$C3009_I < 5] = 1
cses3$nm[cses3$C1004 == 'SVK_2010' & cses3$C3030_LH_3 == 15 & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'SVN_2008' & cses3$C3030_LH_1 == 1 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'SVN_2008' & cses3$C3030_LH_1 == 2 & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'SVN_2008' & cses3$C3030_LH_1 == 3 & cses3$C3009_H < 5] = 1
cses3$nm[cses3$C1004 == 'SVN_2008' & cses3$C3030_LH_1 == 4 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'SVN_2008' & cses3$C3030_LH_1 == 5 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'SVN_2008' & cses3$C3030_LH_1 == 6 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'SVN_2008' & cses3$C3030_LH_1 == 7 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'SVN_2008' & cses3$C3030_LH_1 == 8 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'SWE_2006' & cses3$C3030_LH_1 == 1 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'SWE_2006' & cses3$C3030_LH_1 == 2 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'SWE_2006' & cses3$C3030_LH_1 == 3 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'SWE_2006' & cses3$C3030_LH_1 == 4 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'SWE_2006' & cses3$C3030_LH_1 == 5 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'SWE_2006' & cses3$C3030_LH_1 == 6 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'SWE_2006' & cses3$C3030_LH_1 == 7 & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'SWE_2006' & cses3$C3030_LH_1 == 8 & cses3$C3009_H < 5] = 1
cses3$nm[cses3$C1004 == 'SWE_2006' & cses3$C3030_LH_1 == 9 & cses3$C3009_I < 5] = 1
cses3$nm[cses3$C1004 == 'SWE_2006' & cses3$C3030_LH_2 == 1 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'SWE_2006' & cses3$C3030_LH_2 == 2 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'SWE_2006' & cses3$C3030_LH_2 == 3 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'SWE_2006' & cses3$C3030_LH_2 == 4 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'SWE_2006' & cses3$C3030_LH_2 == 5 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'SWE_2006' & cses3$C3030_LH_2 == 6 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'SWE_2006' & cses3$C3030_LH_2 == 7 & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'SWE_2006' & cses3$C3030_LH_2 == 8 & cses3$C3009_H < 5] = 1
cses3$nm[cses3$C1004 == 'SWE_2006' & cses3$C3030_LH_2 == 9 & cses3$C3009_I < 5] = 1
cses3$nm[cses3$C1004 == 'SWE_2006' & cses3$C3030_LH_3 == 1 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'SWE_2006' & cses3$C3030_LH_3 == 2 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'SWE_2006' & cses3$C3030_LH_3 == 3 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'SWE_2006' & cses3$C3030_LH_3 == 4 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'SWE_2006' & cses3$C3030_LH_3 == 5 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'SWE_2006' & cses3$C3030_LH_3 == 6 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'SWE_2006' & cses3$C3030_LH_3 == 7 & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'SWE_2006' & cses3$C3030_LH_3 == 8 & cses3$C3009_H < 5] = 1
cses3$nm[cses3$C1004 == 'SWE_2006' & cses3$C3030_LH_3 == 9 & cses3$C3009_I < 5] = 1
cses3$nm[cses3$C1004 == 'THA_2007' & cses3$C3030_LH_1 == 1 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'THA_2007' & cses3$C3030_LH_1 == 2 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'THA_2007' & cses3$C3030_LH_1 == 3 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'THA_2007' & cses3$C3030_LH_1 == 4 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'THA_2007' & cses3$C3030_LH_1 == 5 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'THA_2007' & cses3$C3030_LH_1 == 6 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'THA_2007' & cses3$C3030_LH_1 == 7 & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'THA_2007' & cses3$C3030_LH_1 == 8 & cses3$C3009_H < 5] = 1
cses3$nm[cses3$C1004 == 'TUR_2011' & cses3$C3030_LH_1 == 1 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'TUR_2011' & cses3$C3030_LH_1 == 2 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'TUR_2011' & cses3$C3030_LH_1 == 3 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'TUR_2011' & cses3$C3030_LH_1 == 4 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'TUR_2011' & cses3$C3030_LH_1 == 5 & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'TUR_2011' & cses3$C3030_LH_1 == 6 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'TUR_2011' & cses3$C3030_LH_1 == 7 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'TUR_2011' & cses3$C3030_LH_1 == 8 & cses3$C3009_H < 5] = 1
cses3$nm[cses3$C1004 == 'TUR_2011' & cses3$C3030_LH_1 == 9 & cses3$C3009_I < 5] = 1
cses3$nm[cses3$C1004 == 'TUR_2011' & cses3$C3030_LH_2 == 1 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'TUR_2011' & cses3$C3030_LH_2 == 2 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'TUR_2011' & cses3$C3030_LH_2 == 3 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'TUR_2011' & cses3$C3030_LH_2 == 4 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'TUR_2011' & cses3$C3030_LH_2 == 5 & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'TUR_2011' & cses3$C3030_LH_2 == 6 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'TUR_2011' & cses3$C3030_LH_2 == 7 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'TUR_2011' & cses3$C3030_LH_2 == 8 & cses3$C3009_H < 5] = 1
cses3$nm[cses3$C1004 == 'TUR_2011' & cses3$C3030_LH_2 == 9 & cses3$C3009_I < 5] = 1
cses3$nm[cses3$C1004 == 'TUR_2011' & cses3$C3030_LH_3 == 1 & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'TUR_2011' & cses3$C3030_LH_3 == 2 & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'TUR_2011' & cses3$C3030_LH_3 == 3 & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'TUR_2011' & cses3$C3030_LH_3 == 4 & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'TUR_2011' & cses3$C3030_LH_3 == 5 & cses3$C3009_G < 5] = 1
cses3$nm[cses3$C1004 == 'TUR_2011' & cses3$C3030_LH_3 == 6 & cses3$C3009_F < 5] = 1
cses3$nm[cses3$C1004 == 'TUR_2011' & cses3$C3030_LH_3 == 7 & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'TUR_2011' & cses3$C3030_LH_3 == 8 & cses3$C3009_H < 5] = 1
cses3$nm[cses3$C1004 == 'TUR_2011' & cses3$C3030_LH_3 == 9 & cses3$C3009_I < 5] = 1
cses3$nm[cses3$C1004 == 'URY_2009' & (cses3$C3030_LH_1 == 1 | cses3$C3030_PR_1 == 1) & cses3$C3009_B < 5] = 1
cses3$nm[cses3$C1004 == 'URY_2009' & (cses3$C3030_LH_1 == 1 | cses3$C3030_PR_1 == 1) & cses3$C3009_C < 5] = 1
cses3$nm[cses3$C1004 == 'URY_2009' & (cses3$C3030_LH_1 == 1 | cses3$C3030_PR_1 == 1) & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'URY_2009' & (cses3$C3030_LH_1 == 1 | cses3$C3030_PR_1 == 1) & cses3$C3009_D < 5] = 1
cses3$nm[cses3$C1004 == 'URY_2009' & (cses3$C3030_LH_1 == 1 | cses3$C3030_PR_1 == 1) & cses3$C3009_E < 5] = 1
cses3$nm[cses3$C1004 == 'USA_2008' & (cses3$C3030_LH_1 == 1 | cses3$C3030_PR_1 == 1) & cses3$C3009_A < 5] = 1
cses3$nm[cses3$C1004 == 'USA_2008' & (cses3$C3030_LH_1 == 2 | cses3$C3030_PR_1 == 2) & cses3$C3009_B < 5] = 1
table(cses3$nm)

n0 <- clmm(C3019 ~ scale(C2001) + C2002 + scale(C5081_2) + C3018 + scale(C2003) + C20201 + nm + vw + ideo + closeness + (1 | C1004), data = cses3, link="logit")
summary(n0)

n1 <- clmm(C3019 ~ scale(C2001) + C2002 + scale(C5081_2) + C3018 + scale(C2003) + C20201 + nm * vw + ideo + closeness + (1 | C1004), data = cses3, link="logit")
summary(n1)

htmlreg(list(n0, n1)) #appendix 3
@

<<like/dislike winner>>=
### Creating a new variable for the like/dislike of the winning party
cses3$like <- NA
cses3$like <- ifelse(cses3$C1004!="AUS_2007" & cses3$C1004 != 'BRA_2006' & cses3$C1004 != 'CAN_2008' & cses3$C1004 != 'CHL_2009' & cses3$C1004 != 'CZE_2010' & cses3$C1004 != 'DEU_2005' & cses3$C1004 != 'JPN_2007' & cses3$C1004 != 'MEX_2009' & cses3$C1004 != 'SVK_2010' & cses3$C1004 != 'SWE_2006', cses3$C3009_A, cses3$C3009_B)

table(cses3$like)
### Getting rid of Refused, Don't Know and Missing responses like
cses3 <- subset(cses3, cses3$like < 96)
@

<<like/dislike any party binary>>=
table(cses3$C3009_I)
cses3$dislike <- NA
cses3$dislike <- ifelse(cses3$C3009_A<5 | cses3$C3009_B<5 |cses3$C3009_C<5 |cses3$C3009_D<5 | cses3$C3009_E<5|cses3$C3009_F<5|cses3$C3009_G<5|cses3$C3009_H<5|cses3$C3009_I<5, 1, 0)

b0 <- clmm(C3019 ~ scale(C2001) + C2002 + scale(C5081_2) + C3018 + scale(C2003) + C20201 + dislike + vw + ideo + closeness + (1 | C1004), data = cses3, link="logit")
summary(b0)

b1 <- clmm(C3019 ~ scale(C2001) + C2002 + scale(C5081_2) + C3018 + scale(C2003) + C20201 + dislike * vw + ideo + closeness + (1 | C1004), data = cses3, link="logit")
summary(b1)
@

<<like/dislike A/B binary>>=
cses3$dislikeab <- NA
cses3$dislikeab <- ifelse(cses3$dislike == 0, "none", cses3$dislikeab)
cses3$dislikeab <- ifelse(cses3$C3009_A<5 | cses3$C3009_B<5, "ab", cses3$dislikeab)
cses3$dislikeab <- ifelse(cses3$C3009_A>4 & cses3$C3009_B>4 & cses3$dislike==1, "small", cses3$dislikeab)

cses3$dislikeab <- factor(cses3$dislikeab, levels=c("none", "ab", "small"))

ab0 <- clmm(C3019 ~ scale(C2001) + C2002 + scale(C5081_2) + C3018 + scale(C2003) + C20201 + dislikeab + vw + ideo + closeness + (1 | C1004), data = cses3, link="logit")
summary(ab0)
@

<<never vote for A/B>>=
#make a variable for if they would never vote for the party that became PM for the lower house or president (top three mentioned parties)
prop.table(table(never_cses3$C3030_LH_1, never_cses3$C3030_LH_2),1)
table(never_cses3$C3030_LH_1 < 91, never_cses3$C3030_LH_2 >90)
prop.table(table(never_cses3$C3030_LH_1, never_cses3$C3030_LH_2, never_cses3$C3019))

never_cses3$nab <- 0
never_cses3$nab[never_cses3$C1004 == 'AUS_2007' & never_cses3$C3030_LH_1 == 1] = 1
never_cses3$nab[never_cses3$C1004 == 'AUS_2007' & never_cses3$C3030_LH_1 == 2] = 1
never_cses3$nab[never_cses3$C1004 == 'AUS_2007' & never_cses3$C3030_LH_2 == 2] = 1
never_cses3$nab[never_cses3$C1004 == 'AUT_2008' & never_cses3$C3030_LH_1 == 1] = 1
never_cses3$nab[never_cses3$C1004 == 'AUT_2008' & never_cses3$C3030_LH_1 == 2] = 1
never_cses3$nab[never_cses3$C1004 == 'BRA_2006' & (never_cses3$C3030_LH_1 == 1 | never_cses3$C3030_PR_1 == 1)] = 1
never_cses3$nab[never_cses3$C1004 == 'BRA_2006' & (never_cses3$C3030_LH_1 == 6 | never_cses3$C3030_PR_1 == 6)] = 1
never_cses3$nab[never_cses3$C1004 == 'BRA_2010' & (never_cses3$C3030_LH_1 == 4 | never_cses3$C3030_PR_1 == 4)] = 1
never_cses3$nab[never_cses3$C1004 == 'BRA_2010' & (never_cses3$C3030_LH_1 == 1 | never_cses3$C3030_PR_1 == 1)] = 1
never_cses3$nab[never_cses3$C1004 == 'BRA_2010' & (never_cses3$C3030_LH_2 == 1 | never_cses3$C3030_PR_2 == 1)] = 1
never_cses3$nab[never_cses3$C1004 == 'BRA_2010' & (never_cses3$C3030_LH_2 == 4 | never_cses3$C3030_PR_2 == 4)] = 1
never_cses3$nab[never_cses3$C1004 == 'CAN_2008' & never_cses3$C3030_LH_1 == 1] = 1
never_cses3$nab[never_cses3$C1004 == 'CAN_2008' & never_cses3$C3030_LH_1 == 2] = 1
never_cses3$nab[never_cses3$C1004 == 'CHL_2009' & never_cses3$C3030_LH_1 == 1] = 1
never_cses3$nab[never_cses3$C1004 == 'CHL_2009' & never_cses3$C3030_LH_1 == 2] = 1
never_cses3$nab[never_cses3$C1004 == 'CHE_2007' & never_cses3$C3030_LH_1 == 4] = 1
never_cses3$nab[never_cses3$C1004 == 'CHE_2007' & never_cses3$C3030_LH_1 == 3] = 1
never_cses3$nab[never_cses3$C1004 == 'CHE_2007' & never_cses3$C3030_LH_2 == 3] = 1
never_cses3$nab[never_cses3$C1004 == 'HRV_2007' & never_cses3$C3030_LH_1 == 1] = 1
never_cses3$nab[never_cses3$C1004 == 'HRV_2007' & never_cses3$C3030_LH_2 == 1] = 1
never_cses3$nab[never_cses3$C1004 == 'HRV_2007' & never_cses3$C3030_LH_3 == 1] = 1
never_cses3$nab[never_cses3$C1004 == 'HRV_2007' & never_cses3$C3030_LH_1 == 10] = 1
never_cses3$nab[never_cses3$C1004 == 'HRV_2007' & never_cses3$C3030_LH_2 == 10] = 1
never_cses3$nab[never_cses3$C1004 == 'HRV_2007' & never_cses3$C3030_LH_3 == 10] = 1
never_cses3$nab[never_cses3$C1004 == 'CZE_2006' & never_cses3$C3030_LH_1 == 8] = 1
never_cses3$nab[never_cses3$C1004 == 'CZE_2006' & never_cses3$C3030_LH_2 == 8] = 1
never_cses3$nab[never_cses3$C1004 == 'CZE_2006' & never_cses3$C3030_LH_3 == 8] = 1
never_cses3$nab[never_cses3$C1004 == 'CZE_2006' & never_cses3$C3030_LH_1 == 9] = 1
never_cses3$nab[never_cses3$C1004 == 'CZE_2006' & never_cses3$C3030_LH_2 == 9] = 1
never_cses3$nab[never_cses3$C1004 == 'CZE_2006' & never_cses3$C3030_LH_3 == 9] = 1
never_cses3$nab[never_cses3$C1004 == 'CZE_2010' & never_cses3$C3030_LH_1 == 26] = 1
never_cses3$nab[never_cses3$C1004 == 'CZE_2010' & never_cses3$C3030_LH_2 == 26] = 1
never_cses3$nab[never_cses3$C1004 == 'CZE_2010' & never_cses3$C3030_LH_3 == 26] = 1
never_cses3$nab[never_cses3$C1004 == 'CZE_2010' & never_cses3$C3030_LH_1 == 9] = 1
never_cses3$nab[never_cses3$C1004 == 'CZE_2010' & never_cses3$C3030_LH_2 == 9] = 1
never_cses3$nab[never_cses3$C1004 == 'CZE_2010' & never_cses3$C3030_LH_3 == 9] = 1
never_cses3$nab[never_cses3$C1004 == 'DNK_2007' & never_cses3$C3030_LH_1 == 7] = 1
never_cses3$nab[never_cses3$C1004 == 'DNK_2007' & never_cses3$C3030_LH_2 == 7] = 1
never_cses3$nab[never_cses3$C1004 == 'DNK_2007' & never_cses3$C3030_LH_3 == 7] = 1
never_cses3$nab[never_cses3$C1004 == 'DNK_2007' & never_cses3$C3030_LH_1 == 1] = 1
never_cses3$nab[never_cses3$C1004 == 'EST_2011' & never_cses3$C3030_LH_1 == 4] = 1
never_cses3$nab[never_cses3$C1004 == 'EST_2011' & never_cses3$C3030_LH_2 == 4] = 1
never_cses3$nab[never_cses3$C1004 == 'EST_2011' & never_cses3$C3030_LH_3 == 4] = 1
never_cses3$nab[never_cses3$C1004 == 'EST_2011' & never_cses3$C3030_LH_1 == 5] = 1
never_cses3$nab[never_cses3$C1004 == 'EST_2011' & never_cses3$C3030_LH_2 == 5] = 1
never_cses3$nab[never_cses3$C1004 == 'EST_2011' & never_cses3$C3030_LH_3 == 5] = 1
never_cses3$nab[never_cses3$C1004 == 'ESP_2008' & never_cses3$C3030_LH_1 == 2] = 1
never_cses3$nab[never_cses3$C1004 == 'ESP_2008' & never_cses3$C3030_LH_1 == 1] = 1
never_cses3$nab[never_cses3$C1004 == 'DEU_2005' & never_cses3$C3030_LH_1 == 1] = 1
never_cses3$nab[never_cses3$C1004 == 'DEU_2005' & never_cses3$C3030_LH_1 == 3] = 1
never_cses3$nab[never_cses3$C1004 == 'DEU_2005' & never_cses3$C3030_LH_2 == 3] = 1
never_cses3$nab[never_cses3$C1004 == 'DEU_2009' & never_cses3$C3030_LH_1 == 1] = 1
never_cses3$nab[never_cses3$C1004 == 'DEU_2009' & never_cses3$C3030_LH_2 == 1] = 1
never_cses3$nab[never_cses3$C1004 == 'DEU_2009' & never_cses3$C3030_LH_3 == 1] = 1
never_cses3$nab[never_cses3$C1004 == 'DEU_2009' & never_cses3$C3030_LH_1 == 3] = 1
never_cses3$nab[never_cses3$C1004 == 'DEU_2009' & never_cses3$C3030_LH_2 == 3] = 1
never_cses3$nab[never_cses3$C1004 == 'DEU_2009' & never_cses3$C3030_LH_3 == 3] = 1
never_cses3$nab[never_cses3$C1004 == 'FIN_2007' & never_cses3$C3030_LH_1 == 3] = 1
never_cses3$nab[never_cses3$C1004 == 'FIN_2007' & never_cses3$C3030_LH_2 == 3] = 1
never_cses3$nab[never_cses3$C1004 == 'FIN_2007' & never_cses3$C3030_LH_3 == 3] = 1
never_cses3$nab[never_cses3$C1004 == 'FIN_2007' & never_cses3$C3030_LH_1 == 1] = 1
never_cses3$nab[never_cses3$C1004 == 'FIN_2011' & never_cses3$C3030_LH_1 == 3] = 1
never_cses3$nab[never_cses3$C1004 == 'FIN_2011' & never_cses3$C3030_LH_2 == 3] = 1
never_cses3$nab[never_cses3$C1004 == 'FIN_2011' & never_cses3$C3030_LH_3 == 3] = 1
never_cses3$nab[never_cses3$C1004 == 'FIN_2011' & never_cses3$C3030_LH_1 == 1] = 1
never_cses3$nab[never_cses3$C1004 == 'FIN_2011' & never_cses3$C3030_LH_2 == 1] = 1
never_cses3$nab[never_cses3$C1004 == 'FIN_2011' & never_cses3$C3030_LH_3 == 1] = 1
never_cses3$nab[never_cses3$C1004 == 'FRA_2007' & never_cses3$C3030_LH_1 == 6] = 1
never_cses3$nab[never_cses3$C1004 == 'FRA_2007' & never_cses3$C3030_LH_1 == 4] = 1
never_cses3$nab[never_cses3$C1004 == 'GRC_2009' & never_cses3$C3030_LH_1 == 1] = 1
never_cses3$nab[never_cses3$C1004 == 'GRC_2009' & never_cses3$C3030_LH_2 == 1] = 1
never_cses3$nab[never_cses3$C1004 == 'GRC_2009' & never_cses3$C3030_LH_3 == 1] = 1
never_cses3$nab[never_cses3$C1004 == 'GRC_2009' & never_cses3$C3030_LH_1 == 2] = 1
never_cses3$nab[never_cses3$C1004 == 'GRC_2009' & never_cses3$C3030_LH_2 == 2] = 1
never_cses3$nab[never_cses3$C1004 == 'GRC_2009' & never_cses3$C3030_LH_3 == 2] = 1
never_cses3$nab[never_cses3$C1004 == 'ISL_2007' & never_cses3$C3030_LH_1 == 3] = 1
never_cses3$nab[never_cses3$C1004 == 'ISL_2007' & never_cses3$C3030_LH_2 == 3] = 1
never_cses3$nab[never_cses3$C1004 == 'ISL_2007' & never_cses3$C3030_LH_3 == 3] = 1
never_cses3$nab[never_cses3$C1004 == 'ISL_2007' & never_cses3$C3030_LH_1 == 1] = 1
never_cses3$nab[never_cses3$C1004 == 'ISL_2007' & never_cses3$C3030_LH_2 == 1] = 1
never_cses3$nab[never_cses3$C1004 == 'ISL_2007' & never_cses3$C3030_LH_3 == 1] = 1
never_cses3$nab[never_cses3$C1004 == 'ISL_2009' & never_cses3$C3030_LH_1 == 1] = 1
never_cses3$nab[never_cses3$C1004 == 'ISL_2009' & never_cses3$C3030_LH_1 == 3] = 1
never_cses3$nab[never_cses3$C1004 == 'IRL_2007' & never_cses3$C3030_LH_1 == 1] = 1
never_cses3$nab[never_cses3$C1004 == 'IRL_2007' & never_cses3$C3030_LH_1 == 2] = 1
never_cses3$nab[never_cses3$C1004 == 'ISR_2006' & never_cses3$C3030_LH_1 == 1] = 1
never_cses3$nab[never_cses3$C1004 == 'ISR_2006' & never_cses3$C3030_LH_2 == 1] = 1
never_cses3$nab[never_cses3$C1004 == 'ISR_2006' & never_cses3$C3030_LH_3 == 1] = 1
never_cses3$nab[never_cses3$C1004 == 'ISR_2006' & never_cses3$C3030_LH_1 == 2] = 1
never_cses3$nab[never_cses3$C1004 == 'ISR_2006' & never_cses3$C3030_LH_2 == 2] = 1
never_cses3$nab[never_cses3$C1004 == 'ISR_2006' & never_cses3$C3030_LH_3 == 2] = 1
never_cses3$nab[never_cses3$C1004 == 'JPN_2007' & never_cses3$C3030_UH_1 == 1] = 1
never_cses3$nab[never_cses3$C1004 == 'JPN_2007' & never_cses3$C3030_UH_1 == 2] = 1
never_cses3$nab[never_cses3$C1004 == 'JPN_2007' & never_cses3$C3030_UH_2 == 1] = 1
never_cses3$nab[never_cses3$C1004 == 'JPN_2007' & never_cses3$C3030_UH_2 == 2] = 1
never_cses3$nab[never_cses3$C1004 == 'JPN_2007' & never_cses3$C3030_UH_3 == 1] = 1
never_cses3$nab[never_cses3$C1004 == 'KOR_2008' & never_cses3$C3030_LH_1 == 1] = 1
never_cses3$nab[never_cses3$C1004 == 'KOR_2008' & never_cses3$C3030_LH_1 == 2] = 1
never_cses3$nab[never_cses3$C1004 == 'LVA_2010' & never_cses3$C3030_LH_1 == 2] = 1
never_cses3$nab[never_cses3$C1004 == 'LVA_2010' & never_cses3$C3030_LH_2 == 2] = 1
never_cses3$nab[never_cses3$C1004 == 'LVA_2010' & never_cses3$C3030_LH_1 == 1] = 1
never_cses3$nab[never_cses3$C1004 == 'LVA_2010' & never_cses3$C3030_LH_2 == 1] = 1
never_cses3$nab[never_cses3$C1004 == 'MEX_2006' & (never_cses3$C3030_LH_1 == 1 | never_cses3$C3030_PR_1 == 1)] = 1
never_cses3$nab[never_cses3$C1004 == 'MEX_2006' & (never_cses3$C3030_LH_2 == 1 | never_cses3$C3030_PR_2 == 1)] = 1
never_cses3$nab[never_cses3$C1004 == 'MEX_2006' & (never_cses3$C3030_LH_2 == 2 | never_cses3$C3030_PR_2 == 2)] = 1
never_cses3$nab[never_cses3$C1004 == 'MEX_2006' & (never_cses3$C3030_LH_1 == 2 | never_cses3$C3030_PR_1 == 2)] = 1
never_cses3$nab[never_cses3$C1004 == 'MEX_2009' & never_cses3$C3030_LH_1 == 1] = 1
never_cses3$nab[never_cses3$C1004 == 'MEX_2009' & never_cses3$C3030_LH_2 == 1] = 1
never_cses3$nab[never_cses3$C1004 == 'MEX_2009' & never_cses3$C3030_LH_3 == 1] = 1
never_cses3$nab[never_cses3$C1004 == 'MEX_2009' & never_cses3$C3030_LH_1 == 2] = 1
never_cses3$nab[never_cses3$C1004 == 'MEX_2009' & never_cses3$C3030_LH_2 == 2] = 1
never_cses3$nab[never_cses3$C1004 == 'MEX_2009' & never_cses3$C3030_LH_3 == 2] = 1
never_cses3$nab[never_cses3$C1004 == 'NLD_2006' & never_cses3$C3030_LH_1 == 1] = 1
never_cses3$nab[never_cses3$C1004 == 'NLD_2006' & never_cses3$C3030_LH_1 == 2] = 1
never_cses3$nab[never_cses3$C1004 == 'NLD_2006' & never_cses3$C3030_LH_2 == 2] = 1
never_cses3$nab[never_cses3$C1004 == 'NLD_2010' & never_cses3$C3030_LH_1 == 1] = 1
never_cses3$nab[never_cses3$C1004 == 'NLD_2010' & never_cses3$C3030_LH_1 == 2] = 1
never_cses3$nab[never_cses3$C1004 == 'NLD_2010' & never_cses3$C3030_LH_2 == 2] = 1
never_cses3$nab[never_cses3$C1004 == 'NOR_2005' & never_cses3$C3030_LH_1 == 3] = 1
never_cses3$nab[never_cses3$C1004 == 'NOR_2005' & never_cses3$C3030_LH_1 == 8] = 1
never_cses3$nab[never_cses3$C1004 == 'NOR_2009' & never_cses3$C3030_LH_1 == 8] = 1
never_cses3$nab[never_cses3$C1004 == 'NOR_2009' & never_cses3$C3030_LH_2 == 8] = 1
never_cses3$nab[never_cses3$C1004 == 'NOR_2009' & never_cses3$C3030_LH_1 == 3] = 1
never_cses3$nab[never_cses3$C1004 == 'NZL_2008' & never_cses3$C3030_LH_1 == 1] = 1
never_cses3$nab[never_cses3$C1004 == 'NZL_2008' & never_cses3$C3030_LH_1 == 2] = 1
never_cses3$nab[never_cses3$C1004 == 'NZL_2008' & never_cses3$C3030_LH_2 == 2] = 1
never_cses3$nab[never_cses3$C1004 == 'PER_2011' & (never_cses3$C3030_LH_1 == 1 | never_cses3$C3030_PR_1 == 1)] = 1
never_cses3$nab[never_cses3$C1004 == 'PER_2011' & (never_cses3$C3030_LH_1 == 2 | never_cses3$C3030_PR_1 == 2)] = 1
never_cses3$nab[never_cses3$C1004 == 'PER_2011' & (never_cses3$C3030_LH_2 == 1 | never_cses3$C3030_PR_2 == 1)] = 1
never_cses3$nab[never_cses3$C1004 == 'PER_2011' & (never_cses3$C3030_LH_2 == 2 | never_cses3$C3030_PR_2 == 2)] = 1
never_cses3$nab[never_cses3$C1004 == 'PHL_2010' & (never_cses3$C3030_LH_1 == 2 | never_cses3$C3030_PR_1 == 2)] = 1
never_cses3$nab[never_cses3$C1004 == 'PHL_2010' & (never_cses3$C3030_LH_1 == 5 | never_cses3$C3030_PR_1 == 5)] = 1
never_cses3$nab[never_cses3$C1004 == 'PHL_2010' & (never_cses3$C3030_LH_2 == 5 | never_cses3$C3030_PR_2 == 5)] = 1
never_cses3$nab[never_cses3$C1004 == 'PHL_2010' & (never_cses3$C3030_LH_3 == 5 | never_cses3$C3030_PR_3 == 5)] = 1
never_cses3$nab[never_cses3$C1004 == 'POL_2005' & never_cses3$C3030_LH_1 == 6] = 1
never_cses3$nab[never_cses3$C1004 == 'POL_2005' & never_cses3$C3030_LH_2 == 6] = 1
never_cses3$nab[never_cses3$C1004 == 'POL_2005' & never_cses3$C3030_LH_3 == 6] = 1
never_cses3$nab[never_cses3$C1004 == 'POL_2005' & never_cses3$C3030_LH_1 == 8] = 1
never_cses3$nab[never_cses3$C1004 == 'POL_2005' & never_cses3$C3030_LH_2 == 8] = 1
never_cses3$nab[never_cses3$C1004 == 'POL_2005' & never_cses3$C3030_LH_3 == 8] = 1
never_cses3$nab[never_cses3$C1004 == 'POL_2007' & never_cses3$C3030_LH_1 == 6] = 1
never_cses3$nab[never_cses3$C1004 == 'POL_2007' & never_cses3$C3030_LH_2 == 6] = 1
never_cses3$nab[never_cses3$C1004 == 'POL_2007' & never_cses3$C3030_LH_3 == 6] = 1
never_cses3$nab[never_cses3$C1004 == 'POL_2007' & never_cses3$C3030_LH_1 == 4] = 1
never_cses3$nab[never_cses3$C1004 == 'POL_2007' & never_cses3$C3030_LH_2 == 4] = 1
never_cses3$nab[never_cses3$C1004 == 'POL_2007' & never_cses3$C3030_LH_3 == 4] = 1
never_cses3$nab[never_cses3$C1004 == 'PRT_2009' & never_cses3$C3030_LH_1 == 5] = 1
never_cses3$nab[never_cses3$C1004 == 'PRT_2009' & never_cses3$C3030_LH_2 == 5] = 1
never_cses3$nab[never_cses3$C1004 == 'PRT_2009' & never_cses3$C3030_LH_3 == 5] = 1
never_cses3$nab[never_cses3$C1004 == 'PRT_2009' & never_cses3$C3030_LH_1 == 4] = 1
never_cses3$nab[never_cses3$C1004 == 'PRT_2009' & never_cses3$C3030_LH_2 == 4] = 1
never_cses3$nab[never_cses3$C1004 == 'PRT_2009' & never_cses3$C3030_LH_3 == 4] = 1
never_cses3$nab[never_cses3$C1004 == 'ROU_2009' & (never_cses3$C3030_LH_1 == 1 | never_cses3$C3030_PR_1 == 1)] = 1
never_cses3$nab[never_cses3$C1004 == 'ROU_2009' & (never_cses3$C3030_LH_1 == 2 | never_cses3$C3030_PR_1 == 2)] = 1
never_cses3$nab[never_cses3$C1004 == 'ROU_2009' & (never_cses3$C3030_LH_2 == 1 | never_cses3$C3030_PR_2 == 1)] = 1
never_cses3$nab[never_cses3$C1004 == 'ROU_2009' & (never_cses3$C3030_LH_2 == 2 | never_cses3$C3030_PR_2 == 2)] = 1
never_cses3$nab[never_cses3$C1004 == 'ROU_2009' & (never_cses3$C3030_LH_3 == 1 | never_cses3$C3030_PR_3 == 1)] = 1
never_cses3$nab[never_cses3$C1004 == 'ROU_2009' & (never_cses3$C3030_LH_3 == 2 | never_cses3$C3030_PR_4 == 2)] = 1
never_cses3$nab[never_cses3$C1004 == 'SVK_2010' & never_cses3$C3030_LH_1 == 11] = 1
never_cses3$nab[never_cses3$C1004 == 'SVK_2010' & never_cses3$C3030_LH_2 == 11] = 1
never_cses3$nab[never_cses3$C1004 == 'SVK_2010' & never_cses3$C3030_LH_3 == 11] = 1
never_cses3$nab[never_cses3$C1004 == 'SVK_2010' & never_cses3$C3030_LH_1 == 13] = 1
never_cses3$nab[never_cses3$C1004 == 'SVK_2010' & never_cses3$C3030_LH_2 == 13] = 1
never_cses3$nab[never_cses3$C1004 == 'SVK_2010' & never_cses3$C3030_LH_3 == 13] = 1
never_cses3$nab[never_cses3$C1004 == 'SVN_2008' & never_cses3$C3030_LH_1 == 6] = 1
never_cses3$nab[never_cses3$C1004 == 'SVN_2008' & never_cses3$C3030_LH_1 == 7] = 1
never_cses3$nab[never_cses3$C1004 == 'ZAF_2009' & never_cses3$C3030_LH_1 == 1] = 1
never_cses3$nab[never_cses3$C1004 == 'ZAF_2009' & never_cses3$C3030_LH_1 == 2] = 1
never_cses3$nab[never_cses3$C1004 == 'ZAF_2009' & never_cses3$C3030_LH_2 == 2] = 1
never_cses3$nab[never_cses3$C1004 == 'SWE_2006' & never_cses3$C3030_LH_1 == 2] = 1
never_cses3$nab[never_cses3$C1004 == 'SWE_2006' & never_cses3$C3030_LH_2 == 2] = 1
never_cses3$nab[never_cses3$C1004 == 'SWE_2006' & never_cses3$C3030_LH_1 == 5] = 1
never_cses3$nab[never_cses3$C1004 == 'SWE_2006' & never_cses3$C3030_LH_2 == 5] = 1
never_cses3$nab[never_cses3$C1004 == 'SWE_2006' & never_cses3$C3030_LH_3 == 5] = 1
never_cses3$nab[never_cses3$C1004 == 'THA_2007' & never_cses3$C3030_LH_1 == 1] = 1
never_cses3$nab[never_cses3$C1004 == 'THA_2007' & never_cses3$C3030_LH_1 == 2] = 1
never_cses3$nab[never_cses3$C1004 == 'TUR_2011' & never_cses3$C3030_LH_1 == 1] = 1
never_cses3$nab[never_cses3$C1004 == 'TUR_2011' & never_cses3$C3030_LH_2 == 1] = 1
never_cses3$nab[never_cses3$C1004 == 'TUR_2011' & never_cses3$C3030_LH_3 == 1] = 1
never_cses3$nab[never_cses3$C1004 == 'TUR_2011' & never_cses3$C3030_LH_1 == 2] = 1
never_cses3$nab[never_cses3$C1004 == 'TUR_2011' & never_cses3$C3030_LH_2 == 2] = 1
never_cses3$nab[never_cses3$C1004 == 'TUR_2011' & never_cses3$C3030_LH_3 == 2] = 1
never_cses3$nab[never_cses3$C1004 == 'USA_2008' & (never_cses3$C3030_LH_1 == 1 | never_cses3$C3030_PR_1 == 1)] = 1
never_cses3$nab[never_cses3$C1004 == 'USA_2008' & (never_cses3$C3030_LH_1 == 2 | never_cses3$C3030_PR_1 == 2)] = 1
never_cses3$nab[never_cses3$C1004 == 'USA_2008' & (never_cses3$C3030_LH_2 == 1 | never_cses3$C3030_PR_2 == 1)] = 1
never_cses3$nab[never_cses3$C1004 == 'USA_2008' & (never_cses3$C3030_LH_2 == 2 | never_cses3$C3030_PR_2 == 2)] = 1
never_cses3$nab[never_cses3$C1004 == 'USA_2008' & (never_cses3$C3030_LH_3 == 1 | never_cses3$C3030_PR_3 == 1)] = 1
never_cses3$nab[never_cses3$C1004 == 'USA_2008' & (never_cses3$C3030_LH_3 == 2 | never_cses3$C3030_PR_3 == 2)] = 1
never_cses3$nab[never_cses3$C1004 == 'URY_2009' & (never_cses3$C3030_LH_1 == 1 | never_cses3$C3030_PR_1 == 1)] = 1
never_cses3$nab[never_cses3$C1004 == 'URY_2009' & (never_cses3$C3030_LH_1 == 3 | never_cses3$C3030_PR_1 == 3)] = 1
table(never_cses3$nab)
never_cses3$nab <- ifelse(never_cses3$neverparty == 0, -1, never_cses3$nab)
never_cses3$nab <- factor(never_cses3$nab)

b2 <- clmm(C3019 ~ scale(C2001) + C2002 + scale(C5081_2) + C3018 + scale(C2003) + C20201 + nab + vw + ideo + closeness + (1 | C1004), data = never_cses3, link="logit")
summary(b2)
 @


<<models>>=
cses3$vl <- factor(cses3$vw, levels=c("1", "0", "-1"))

f0.2 <- clmm(C3019 ~ scale(C2001) + C2002 + scale(C5081_2) + C3018 + scale(C2003) + C20201 + neverparty + vw + ideo + closeness + (1 | C1004), data = never_cses3, link="logit")
summary(f0.2)

f1.2 <- clmm(C3019 ~ scale(C2001) + C2002 + scale(C5081_2) + C3018 + scale(C2003) + C20201 + neverparty*vw + ideo + closeness + (1 | C1004), data = never_cses3, link="logit")
summary(f1.2)

cses3$vl <- factor(cses3$vw, levels=c("1", "0", "-1"))

f0 <- clmm(C3019 ~ scale(C2001) + C2002 + scale(C5081_2) + C3018 + scale(C2003) + C20201 + like + vl + ideo + closeness + (1 | C1004), data = cses3, link="logit")
summary(f0)

f1 <- clmm(C3019 ~ scale(C2001) + C2002 + scale(C5081_2) + C3018 + scale(C2003) + C20201 + like*vl + ideo + closeness + (1 | C1004), data = cses3, link="logit")
summary(f1)

never_cses3$vl <- factor(never_cses3$vw, levels=c("1", "0", "-1"))

f2 <- clmm(C3019 ~ scale(C2001) + C2002 + scale(C5081_2) + C3018 + scale(C2003) + C20201 + never + vl + ideo + closeness + (1 | C1004), data = never_cses3, link="logit")
summary(f2)

f2.2 <- clmm(C3019 ~ scale(C2001) + C2002 + scale(C5081_2) + C3018 + scale(C2003) + C20201 + never*vl + ideo + closeness + (1 | C1004), data = never_cses3, link="logit")
summary(f2.2)

htmlreg(list(f0.2, b0, b2, ab0)) #table 2
htmlreg(list(b1, f1.2, f0, f1, f2, f2.2)) #table 4
htmlreg(list(fc0, fc1, fc2, fc3)) #table 5
@

<<4 types of partisan>>=
cses3$open <- NA
cses3$apathetic <- NA
cses3$negative <- NA
cses3$closed <- NA

cses3$open <- ifelse(cses3$closeness > 2 & cses3$dislike != 1, 1, 0)
cses3$apathetic <- ifelse(cses3$closeness < 3 & cses3$dislike != 1, 1, 0)
cses3$negative <- ifelse(cses3$closeness < 3 & cses3$dislike == 1, 1, 0)
cses3$closed <- ifelse(cses3$closeness > 2 & cses3$dislike == 1, 1, 0)

cses3$types <- 999
cses3$types <- ifelse(cses3$open == 1, "open", cses3$types)
cses3$types <- ifelse(cses3$apathetic == 1, "apathetic", cses3$types)
cses3$types <- ifelse(cses3$negative == 1, "negative", cses3$types)
cses3$types <- ifelse(cses3$closed == 1, "closed", cses3$types)
table(cses3$types)
cses3$types <- factor(cses3$types, levels=c("negative", "open", "apathetic", "closed"))
cses3$types2 <- factor(cses3$types, levels=c("open", "negative", "apathetic", "closed"))
cses3$types3 <- factor(cses3$types, levels=c("apathetic", "open", "negative", "closed"))

q1 <- clmm(C3019 ~ types + scale(C2001) + C2002 + scale(C5081_2) + C3018 + scale(C2003) + C20201 + vw + ideo + (1 | C1004), data = cses3, link="logit")
summary(q1)

q2 <- clmm(C3019 ~ types2 + scale(C2001) + C2002 + scale(C5081_2) + C3018 + scale(C2003) + C20201 + vw + ideo + (1 | C1004), data = cses3, link="logit")
summary(q2)

q3 <- clmm(C3019 ~ types3 + scale(C2001) + C2002 + scale(C5081_2) + C3018 + scale(C2003) + C20201 + vw + ideo + (1 | C1004), data = cses3, link="logit")
summary(q3)

never_cses3$open <- NA
never_cses3$apathetic <- NA
never_cses3$negative <- NA
never_cses3$closed <- NA

never_cses3$open <- ifelse(never_cses3$closeness > 2 & never_cses3$neverparty != 1, 1, 0)
never_cses3$apathetic <- ifelse(never_cses3$closeness < 3 & never_cses3$neverparty != 1, 1, 0)
never_cses3$negative <- ifelse(never_cses3$closeness < 3 & never_cses3$neverparty == 1, 1, 0)
never_cses3$closed <- ifelse(never_cses3$closeness > 2 & never_cses3$neverparty == 1, 1, 0)

never_cses3$types <- 999
never_cses3$types <- ifelse(never_cses3$open == 1, "open", never_cses3$types)
never_cses3$types <- ifelse(never_cses3$apathetic == 1, "apathetic", never_cses3$types)
never_cses3$types <- ifelse(never_cses3$negative == 1, "negative", never_cses3$types)
never_cses3$types <- ifelse(never_cses3$closed == 1, "closed", never_cses3$types)
table(never_cses3$types)
never_cses3$types <- factor(never_cses3$types, levels=c("negative", "open", "apathetic", "closed"))
never_cses3$types2 <- factor(never_cses3$types, levels=c("open", "negative", "apathetic", "closed"))
never_cses3$types3 <- factor(never_cses3$types, levels=c("apathetic", "open", "negative", "closed"))

r1 <- clmm(C3019 ~ types + scale(C2001) + C2002 + scale(C5081_2) + C3018 + scale(C2003) + C20201 + vw + ideo + (1 | C1004), data = never_cses3, link="logit")
summary(r1)

r2 <- clmm(C3019 ~ types2 + scale(C2001) + C2002 + scale(C5081_2) + C3018 + scale(C2003) + C20201 + vw + ideo + (1 | C1004), data = never_cses3, link="logit")
summary(r2)

r3 <- clmm(C3019 ~ types3 + scale(C2001) + C2002 + scale(C5081_2) + C3018 + scale(C2003) + C20201 + vw + ideo + (1 | C1004), data = never_cses3, link="logit")
summary(r3)

htmlreg(list(q1, q2, r1, r2)) #table 3

htmlreg(list(q3, r3)) #appendix 4
@

<<w/o pm party members>>=
cses3sub <- cses3
cses3sub <- cses3sub[!c(cses3sub$C1004=="AUS_2007" & cses3sub$C3023_LH_DC == 2),]
cses3sub <- cses3sub[!c(cses3sub$C1004=="AUT_2008" & cses3sub$C3023_LH_PL == 1),]
cses3sub <- cses3sub[!c(cses3sub$C1004=="BRA_2006" & cses3sub$C3023_PR_1 == 1),]
cses3sub <- cses3sub[!c(cses3sub$C1004=="BRA_2010" & cses3sub$C3023_PR_1 == 4),]
cses3sub <- cses3sub[!c(cses3sub$C1004=="CAN_2008" & cses3sub$C3023_LH_DC == 1),]
cses3sub <- cses3sub[!c(cses3sub$C1004=="CHL_2009" & cses3sub$C3023_LH_DC == 2),]
cses3sub <- cses3sub[!c(cses3sub$C1004=="HRV_2007" & cses3sub$C3023_LH_PL == 1),]
cses3sub <- cses3sub[!c(cses3sub$C1004=="CZE_2006" & cses3sub$C3023_LH_PL == 8),]
cses3sub <- cses3sub[!c(cses3sub$C1004=="CZE_2010" & cses3sub$C3023_LH_PL == 26),]
cses3sub <- cses3sub[!c(cses3sub$C1004=="CHE_2007" & cses3sub$C3023_LH_PL == 4),]
cses3sub <- cses3sub[!c(cses3sub$C1004=="DEU_2005" & cses3sub$C3023_LH_DC == 1),]
cses3sub <- cses3sub[!c(cses3sub$C1004=="DEU_2009" & cses3sub$C3023_LH_DC == 1),]
cses3sub <- cses3sub[!c(cses3sub$C1004=="DNK_2007" & cses3sub$C3023_LH_PL == 7),]
cses3sub <- cses3sub[!c(cses3sub$C1004=="ESP_2008" & cses3sub$C3023_LH_PL == 2),]
cses3sub <- cses3sub[!c(cses3sub$C1004=="EST_2011" & cses3sub$C3023_LH_DC == 4),]
cses3sub <- cses3sub[!c(cses3sub$C1004=="FIN_2007" & cses3sub$C3023_LH_PL == 1),]
cses3sub <- cses3sub[!c(cses3sub$C1004=="FIN_2011" & cses3sub$C3023_LH_PL == 3),]
cses3sub <- cses3sub[!c(cses3sub$C1004=="FRA_2007" & cses3sub$C3023_LH_DC == 6),]
cses3sub <- cses3sub[!c(cses3sub$C1004=="GRC_2009" & cses3sub$C3023_LH_PL == 1),]
cses3sub <- cses3sub[!c(cses3sub$C1004=="IRL_2007" & cses3sub$C3023_LH_PL == 1),]
cses3sub <- cses3sub[!c(cses3sub$C1004=="ISL_2007" & cses3sub$C3023_LH_PL == 3),]
cses3sub <- cses3sub[!c(cses3sub$C1004=="ISL_2009" & cses3sub$C3023_LH_PL == 1),]
cses3sub <- cses3sub[!c(cses3sub$C1004=="ISR_2006" & cses3sub$C3023_LH_PL == 1),]
cses3sub <- cses3sub[!c(cses3sub$C1004=="JPN_2007" & cses3sub$C3023_UH_PL == 1),]
cses3sub <- cses3sub[!c(cses3sub$C1004=="LVA_2010" & cses3sub$C3023_LH_DC == 2),]
cses3sub <- cses3sub[!c(cses3sub$C1004=="MEX_2006" & cses3sub$C3023_LH_DC == 1),]
cses3sub <- cses3sub[!c(cses3sub$C1004=="MEX_2009" & cses3sub$C3023_LH_DC == 2),]
cses3sub <- cses3sub[!c(cses3sub$C1004=="NLD_2006" & cses3sub$C3023_LH_PL == 1),]
cses3sub <- cses3sub[!c(cses3sub$C1004=="NLD_2010" & cses3sub$C3023_LH_PL == 1),]
cses3sub <- cses3sub[!c(cses3sub$C1004=="NZL_2008" & cses3sub$C3023_LH_DC == 1),]
cses3sub <- cses3sub[!c(cses3sub$C1004=="NOR_2005" & cses3sub$C3023_LH_PL == 3),]
cses3sub <- cses3sub[!c(cses3sub$C1004=="NOR_2009" & cses3sub$C3023_LH_PL == 3),]
cses3sub <- cses3sub[!c(cses3sub$C1004=="PER_2011" & cses3sub$C3023_PR_1 == 1),]
cses3sub <- cses3sub[!c(cses3sub$C1004=="PHL_2010" & cses3sub$C3023_PR_1 == 2),]
cses3sub <- cses3sub[!c(cses3sub$C1004=="POL_2005" & cses3sub$C3023_LH_PL == 6),]
cses3sub <- cses3sub[!c(cses3sub$C1004=="POL_2007" & cses3sub$C3023_LH_PL == 6),]
cses3sub <- cses3sub[!c(cses3sub$C1004=="PRT_2009" & cses3sub$C3023_LH_PL == 5),]
cses3sub <- cses3sub[!c(cses3sub$C1004=="ROU_2009" & cses3sub$C3023_PR_1 == 1),]
cses3sub <- cses3sub[!c(cses3sub$C1004=="SVK_2010" & cses3sub$C3023_LH_PL == 11),]
cses3sub <- cses3sub[!c(cses3sub$C1004=="SVN_2008" & cses3sub$C3023_LH_PL == 7),]
cses3sub <- cses3sub[!c(cses3sub$C1004=="KOR_2008" & cses3sub$C3023_LH_DC == 2),]
cses3sub <- cses3sub[!c(cses3sub$C1004=="ZAF_2009" & cses3sub$C3023_LH_PL == 1),]
cses3sub <- cses3sub[!c(cses3sub$C1004=="SWE_2006" & cses3sub$C3023_LH_PL == 5),]
cses3sub <- cses3sub[!c(cses3sub$C1004=="THA_2007" & cses3sub$C3023_LH_DC == 1),]
cses3sub <- cses3sub[!c(cses3sub$C1004=="TUR_2011" & cses3sub$C3023_LH_PL == 1),]
cses3sub <- cses3sub[!c(cses3sub$C1004=="USA_2008" & cses3sub$C3023_PR_1 == 1),]
cses3sub <- cses3sub[!c(cses3sub$C1004=="URY_2009" & cses3sub$C3023_PR_1 == 3),]

#remove countries in which the winning party is not in coalition
cses3sub <- subset(cses3sub, cses3sub$C1006_NAM != 'Australia' & cses3sub$C1006_NAM != 'Brazil' & cses3sub$C1006_NAM != 'Canada' & cses3sub$C1006_NAM != 'Chile' & cses3sub$C1006_NAM != 'Greece' & cses3sub$C1004 != 'MEX_2009' & cses3sub$C1004 != 'NZL_2008' & cses3sub$C1006_NAM != 'Peru' & cses3sub$C1006_NAM != 'Portugal' & cses3sub$C1004 != 'ZAF_2009' & cses3sub$C1004 != 'KOR_2008' & cses3sub$C1004 != 'ESP_2008'& cses3sub$C1006_NAM != 'Turkey' & cses3sub$C1004 != 'URY_2009' & cses3sub$C1004 != 'USA_2008')

###subset dataset for countries asked "ARE THERE OTHERS FOR WHICH R WOULD NEVER VOTE"
never_cses3sub <- subset(cses3sub, cses3sub$C1004 != 'CHL_2009'& cses3sub$C1004 != 'FRA_2007'& cses3sub$C1004 != 'NOR_2005' & cses3sub$C1004 != 'KOR_2008' & cses3sub$C1004 != 'URY_2009') #plus taiwan but already dropped 
###recode ARE THERE OTHERS FOR WHICH R WOULD NEVER VOTE, LOWER HOUSE
never_cses3sub <- subset(never_cses3sub, never_cses3sub$C3029_LH < 6 | never_cses3sub$C3029_PR < 6 | never_cses3sub$C3029_UH < 6) #questionaire of origin skips non-voters according to code-book, which explains the high missing rate
never_cses3sub$neverparty <- ifelse(never_cses3sub$C3029_LH == 1 | never_cses3sub$C3029_PR == 1 | never_cses3sub$C3029_UH == 1, 1, 0)

fc0 <- clmm(C3019 ~ scale(C2001) + C2002 + scale(C5081_2) + C3018 + scale(C2003) + C20201 + like + vw + ideo + closeness + (1 | C1004), data = cses3sub, link="logit")
summary(fc0)

fc1 <- clmm(C3019 ~ scale(C2001) + C2002 + scale(C5081_2) + C3018 + scale(C2003) + C20201 + like * vw + ideo + closeness + (1 | C1004), data = cses3sub, link="logit")
summary(fc1)

fc2 <- clmm(C3019 ~ scale(C2001) + C2002 + scale(C5081_2) + C3018 + scale(C2003) + C20201 + never + vw + ideo + closeness + (1 | C1004), data = never_cses3sub, link="logit")
summary(fc2)

fc3 <- clmm(C3019 ~ scale(C2001) + C2002 + scale(C5081_2) + C3018 + scale(C2003) + C20201 + never * vw + ideo + closeness + (1 | C1004), data = never_cses3sub, link="logit")
summary(fc3)
@

<<Table 1>>=
prop.table(table(never_cses3$C1004, never_cses3$neverparty),1)
prop.table(table(cses3$C1004, cses3$dislike),1)
prop.table(table(cses3$C1004, cses3$C3009_A < 5 | cses3$C3009_B < 5),1)
prop.table(table(cses3$C1004, cses3$closeness > 1),1)
@

\end{document}